I did something like this...with a picture being displayed and a text image flashing the message "Loading.....Please Wait!"
1. Set the Database Startup options so that no form is displayed when you open the database.
2. Create a form (saved as something like frmSplashScreen) that contains the image you want. Set it's properties as follows...
Caption = " "
Default View = "Single Form"
Views Allowed = "Form"
Scroll Bars = "Neither"
Record Selectors, Navigation Buttons, Dividing Lines = "No"
Auto Resize, Auto Centre = "Yes"
Border Style = "None"
Control Box = "No"
Min Max Buttons = "None"
Close Button = "No"
Other properties set to default
This is the code I put behind my Splash form...
Option Compare Database
Private Sub Form_Load()
TimerInterval = 500
End Sub
Sub Form_Timer()
Static intShowPicture As Integer
If intShowPicture Then
' Show bitmap.
Image28.Picture = "Drive:\Path\loading.bmp"
Else
' Don't show bitmap.
Image28.Picture = ""
End If
intShowPicture = Not intShowPicture
End Sub
3. Create a module (saved as something like basSplashScreen)
In module code as follows...
Dim gSplashStart ' The time when the splash screen opened.
Dim gSplashInterval ' The minimum time to leave the splash screen up.
Dim gSplashForm ' The name of the splash screen form.
'***********************************************************
' FUNCTION: SplashStart()
'
' PURPOSE: Used to invoke the splash screen form specified
' by the SplashForm argument
'
' ARGUMENTS:
' SplashForm - The name of the form to use as the
' splash screen.
' SplashInterval - The minimum time, in seconds, that
' the splash screen must
' remain active on the screen.
'
'***********************************************************
Function SplashStart(ByVal SplashForm As String, ByVal SplashInterval As Integer)
DoCmd.OpenForm SplashForm ' Open the splash screen form
gSplashStart = Timer ' Set the starting time
gSplashInterval = SplashInterval ' Set global interval time
gSplashForm = SplashForm ' Set global form name
End Function
'***********************************************************
' FUNCTION: SplashEnd()
'
' PURPOSE: Used to close the splash screen form opened by
' the SplashStart() function.
' This function checks to ensure that the splash
' screen remains active until the user-specified
' interval has expired
'
'***********************************************************
Function SplashEnd()
Dim RetVal
' Loop until the splash screen has been active for the desired interval
Do Until (Timer - gSplashStart) > gSplashInterval
RetVal = DoEvents() ' Yield control so other applications can process.
Loop
DoCmd.Close acForm, gSplashForm ' Close the splash screen
End Function
4. Created an AutoExec Macro with two RunCode functions (see below) then an OpenForm to display your main form or menu
SplashStart ("frmSplashScreen", 5)
SplashEnd()