the following script catches if a user changes the computers date or time, to make it look like they entered data at a previous time or date.
"master" file has among others the following two fields:
timelastupdated,n,10 'to store seconds past midnight
datelastupdated,d,08 'to store last date
"Master" is the file for the first form that loads, "Master Menu", which never closes.
this script could be stored in the "Can Change" event in field rules for every appropriate file you wish to protect.
if you trap the users attempt, you could record same in another field and a5.close() - note that i haven't figured out how to account for the time change, twice a year.
dim test1 as c
test1=""
if is_object("master menu")
else
form.load("master menu")
test1="1"
end if
:master menu:tables:master.fetch_first()
'ui_msg_box("","got this far")
x=toseconds(time())
y=date()
if :master menu:tables:master.datelastupdated > y
ui_msg_box("","date greater")
end if
if :master menu:tables:master.datelastupdated=y .and. :master menu:tables:master.timelastupdated > x
ui_msg_box("","time greater greater")
end if
:master menu:tables:master.change_begin()
:master menu:tables:master.timelastupdated=toseconds(time())
:master menu:tables:master.datelastupdated=date()
:master menu:tables:master.change_end()
begin:
'ui_msg_box("","at begin")
if test1="1"
:master menu.close()
end if
Martin, Dallas
"master" file has among others the following two fields:
timelastupdated,n,10 'to store seconds past midnight
datelastupdated,d,08 'to store last date
"Master" is the file for the first form that loads, "Master Menu", which never closes.
this script could be stored in the "Can Change" event in field rules for every appropriate file you wish to protect.
if you trap the users attempt, you could record same in another field and a5.close() - note that i haven't figured out how to account for the time change, twice a year.
dim test1 as c
test1=""
if is_object("master menu")
else
form.load("master menu")
test1="1"
end if
:master menu:tables:master.fetch_first()
'ui_msg_box("","got this far")
x=toseconds(time())
y=date()
if :master menu:tables:master.datelastupdated > y
ui_msg_box("","date greater")
end if
if :master menu:tables:master.datelastupdated=y .and. :master menu:tables:master.timelastupdated > x
ui_msg_box("","time greater greater")
end if
:master menu:tables:master.change_begin()
:master menu:tables:master.timelastupdated=toseconds(time())
:master menu:tables:master.datelastupdated=date()
:master menu:tables:master.change_end()
begin:
'ui_msg_box("","at begin")
if test1="1"
:master menu.close()
end if
Martin, Dallas