First create a command button that will display "Close Form" or something like that to the user, lets call it cbCloseForm. Then place the following code in the On_CLick event for the cbCloseForm button:
Private Sub cbCloseForm_Click()
Me.TimerInterval = 3000
End Sub
This will set your timer to 3 seconds (timer interval is set in milliseconds, hence 3000 = 3 seconds)
Then for your Forms "On Timer" event procedure place the code that you would normally use for your close button:
Private Sub Form_Timer()
On Error GoTo Err_Command1_Click
DoCmd.Close
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
This will pause for 3 seconds before closing the form. To adjust the time simply change the number (in milliseconds) in the cbCloseForm_Click() event procedure.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.