Sure. If you have an AutoExec macro, open the form "HiddenForm" along with your other actions, but in "hidden" mode. If you have a form set to open when users open your DB, add this line to the Open property of that form:
DoCmd.OpenForm "HiddenForm", , , , , acHidden In the Timer property of your hidden form, put If Now < CDate(Date + 0.99) Then ' Date + .99 is approximately 11:45PM "today" DoCmd.Quit End If And in the Timer Interval property of your hidden form, put the number of seconds you want it to wait between checking. So if you put 6000, it will check that If statement every 10 minutes. Let me know if you have more questions. Eric > -----Original Message----- > From: AccessDevelopers@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of jmw95823 > Sent: Tuesday, July 19, 2005 11:58 AM > To: AccessDevelopers@yahoogroups.com > Subject: [AccessDevelopers] Re: Application.Quit Based on Time of Day > > Thanks, Eric. Would appreciate some example code if anyone > has it handy. Jim > --- In AccessDevelopers@yahoogroups.com, "Eric Douglas" > <[EMAIL PROTECTED]> wrote: > > Jim, > > > > You can have open a hidden form with code in the Timer property to > > periodically check what time it is, and quit the app if it > succeeds. > > > > Eric > > > > > > > -----Original Message----- > > > From: AccessDevelopers@yahoogroups.com > > > [mailto:[EMAIL PROTECTED] On Behalf Of jmw95823 > > > Sent: Tuesday, July 19, 2005 7:23 AM > > > To: AccessDevelopers@yahoogroups.com > > > Subject: [AccessDevelopers] Application.Quit Based on Time of Day > > > > > > I set up a daily (nightly) backup of a backend .mdb via XP's > > > Scheduled Tasks utility and it ran fine last night at 11:45 pm. > > > I've noticed that sometimes the lock file (.ldb) is there > and would > > > like to get rid of it before the backup occurs (even > though you can > > > set the backup to run while files are still being written > to). Can > > > I run code to quit the application based on time of day? I would > > > want the file closed (with no .ldb) just before the > backup occurs. > > > Thanks for any help. > > > Jim > > > > > > > > > > > > > > > > > > Please zip all files prior to uploading to Files section. > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > > > > > > > Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/