Close form after certain amount of time

D

Dave

Hi

How can I make a form close, say 5 seconds after it has loaded. This isnt
for a startup splash screen, but I guess its a similar thing. There will be
no user input, I just want to display it for a chosen length of time, and
then close it.

I am sure this is an easy one, but I am new to access, and so any help or
pointers much appreciated,

Thanks in advance.
 
K

Ken Snell [MVP]

Set the form's Timer Interval property to 5000.

Use the form's Timer event to run this code:

Private Sub Form_Timer()
Me.TimerInterval = 0
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
 
D

Dave

Thanks a lot for your help Ken.

Dave


Ken Snell said:
Set the form's Timer Interval property to 5000.

Use the form's Timer event to run this code:

Private Sub Form_Timer()
Me.TimerInterval = 0
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
 
Top