Closing opening Form with timer then opening Main Menu

BillBee

Registered User.
Local time
Yesterday, 21:26
Joined
Aug 31, 2008
Messages
137
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.

Private Sub Cover_Page_Form_Load()
OpenTimer = Timer

End Sub

Private Sub Cover_Page_Form_Timer()
If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes


End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process. Thanks
 
I wouldn't bother with all that. Just put the code to open the new form and close this one in the timer event of the form, and set the timer interval appropriately.
 
Do you mean something like this.
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "Main Menu"
If (Timer - OpenTime) > 5 Then DoCmd.Close acForm, "Cover Page Form"
End Sub

Sorry
 
Last edited:
Uh, like what?
 
Do you mean something like this.
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "Main Menu"
If (Timer - OpenTime) > 5 Then DoCmd.Close acForm, "Cover Page Form"
End Sub

Sorry
 
No, you have it in the open event, I suggested the "On Timer" event, with the appropriate interval in the Timer Interval property. The only code would be:

DoCmd.OpenForm "Main Menu"
DoCmd.Close acForm, "Cover Page Form"
 

Users who are viewing this thread

Back
Top Bottom