Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delay at startup

Status
Not open for further replies.
Mar 27, 2002
168
NL
is it possible to set a little (5 seconds) delay before the first form is starting.
Reason why: I have a picture to show first at startup. But it starts so quick, the pic is never ever seen ;)

anyone had a suggestion?

Gerard
 

Morning Gerard

What you are wanting is a splash screen
todo this

put in the timer interval event 2000
and in the Timer event
type docmd.close

this will close the form with the picture on in 2 seconds

hope this is what you want
regards
jo
 
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()

 
Thnx Jo, and Shortie for youre replies. I think I can use it, but have to find solution for my start-up form

Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top