VBA Timer

neelyjer
neelyjer used Ask the Experts™
on
Here goes...

I have a workbook that when opened, loads a login form I created (Well the EE experts pretty much created it).  What I'd like to do, is open a form prior to the login displays a picture for a few seconds, then closes the form and loads the login form.  Can someone point me in the right direction?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008
Commented:
This is called a splash dialog. Here is sample code to display a splash dialog and have it close after a specified amount of time or if the form is clicked.

Place this code in the form module:

Private mTimeoutTime As Date

Public Function CheckTimer() As Boolean

   If Now() > mTimeoutTime Then
      CheckTimer = True
      Me.Hide
   End If

End Function

Private Sub UserForm_Activate()

   mTimeoutTime = Now() + TimeSerial(0, 0, 5)

End Sub

Private Sub UserForm_Click()

   mTimeoutTime = 0

End Sub

Use this code to display the splash form:

Public Sub DisplaySplash()

   frmSplash.Show vbModeless
   Do
      DoEvents
   Loop Until frmSplash.CheckTimer

End Sub

Kevin

Author

Commented:
Zorvek --

Absolute Perfection!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial