When opening, form to display for specified period

G

Guest

At the moment my mdb (Access 2002) opens onto the inbuilt switchboard and
menus.
I would like to introduce a different form upon startup, which is no problem
in itself, I know how to do that.
But then I want that form (which will contain a "message for the day") to
remain there for only a fixed period, probably 5 seconds, and then to
automatically close itself and open the usual switchboard.
Let's say the form is called Message, and the switchboard form is called
(well, Switchboard) - how would I code this behaviour?
Many thanks
CW
CW
 
F

fredg

At the moment my mdb (Access 2002) opens onto the inbuilt switchboard and
menus.
I would like to introduce a different form upon startup, which is no problem
in itself, I know how to do that.
But then I want that form (which will contain a "message for the day") to
remain there for only a fixed period, probably 5 seconds, and then to
automatically close itself and open the usual switchboard.
Let's say the form is called Message, and the switchboard form is called
(well, Switchboard) - how would I code this behaviour?
Many thanks
CW
CW

You will have to make your own unbound message form.
Add whatever label with the message you want to display.
Then place the following code in the Form's events:

Option Compare Database
Option Explicit
Dim dteTime As Date

Private Sub Form_Open(Cancel As Integer)
dteTime = Now()
End Sub
===

Private Sub Form_Timer()
If DateDiff("s", [dteTime], Now()) = 5 Then
DoCmd.Close acForm, Me.Name
End If
End Sub
===

Set the Form's Timer Interval to 1000.

Code this form's Close event:

DoCmd.OpenForm "Switchboard"

The above code will close the form in 5 seconds and in turn, open the
switchboard.

Change Tools + Startup + Display Form/Page to this Message form.
 
G

Guest

Fred -
Many thanks - I appreciate the detailed step by step advice.
CW

fredg said:
At the moment my mdb (Access 2002) opens onto the inbuilt switchboard and
menus.
I would like to introduce a different form upon startup, which is no problem
in itself, I know how to do that.
But then I want that form (which will contain a "message for the day") to
remain there for only a fixed period, probably 5 seconds, and then to
automatically close itself and open the usual switchboard.
Let's say the form is called Message, and the switchboard form is called
(well, Switchboard) - how would I code this behaviour?
Many thanks
CW
CW

You will have to make your own unbound message form.
Add whatever label with the message you want to display.
Then place the following code in the Form's events:

Option Compare Database
Option Explicit
Dim dteTime As Date

Private Sub Form_Open(Cancel As Integer)
dteTime = Now()
End Sub
===

Private Sub Form_Timer()
If DateDiff("s", [dteTime], Now()) = 5 Then
DoCmd.Close acForm, Me.Name
End If
End Sub
===

Set the Form's Timer Interval to 1000.

Code this form's Close event:

DoCmd.OpenForm "Switchboard"

The above code will close the form in 5 seconds and in turn, open the
switchboard.

Change Tools + Startup + Display Form/Page to this Message form.
 
B

Bobby Webb

I am looking for a access database just for purchase order tracking... any
ideas anyone?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top