Link to home
Start Free TrialLog in
Avatar of Lapchien
LapchienFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Time out on form - automatically close a form if no activity

I have a load of users that leave an inputting screen open, rather than close it and return to the front form.

Is it possible (!) to have a timer running on the open form that checks to see if a certain field is null, say every 3 minutes, and if it is null will force that form to close - maybe even ignorning any errors that might occur as a result of forcing a form to close, such as part completing a record..?  Not bothered about keeping changes to a part-completed record.

Thanks
Lapchien

Avatar of bluelizard
bluelizard
Flag of Switzerland image

you can use the OnTimer event of the form and set the interval to 3 minutes


--bluelizard
Avatar of Lapchien

ASKER

yes - but what would the code be to check if a field is null, something like

if isnull (me.myfield) then

drop anything input on the form (don't know the code for this)

then

docmd.close

?

What is the timer interval for 3 minutes?
actually, what i would do is first to save the record with the code Me.Refresh (and use an error handler with "resume next" to catch any errors), then close the form with this code

  DoCmd.Close acForm, "MyForm", acSaveNo

(this ignores all design changes, if any were done; sometimes access thinks someone has changed the design even though this wasn't really the case, probably when filters are set or similar).


--bluelizard
ASKER CERTIFIED SOLUTION
Avatar of bluelizard
bluelizard
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial