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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delay in msgbox 1

Status
Not open for further replies.

osi2301

Programmer
Jul 3, 2004
75
AU
I have a msgbox that I want to display when opening a form. I don't want the msgbox to display immediately upon opening. I want a delay of about 5 seconds.

I insert the TIMER INTERVAL of 5000 and place the msgbox in TIMER EVENT. Then when I open the form it waits five seconds before displaying the message but then keeps displaying it every five seconds in a closed loop. How do I make it fire only once?
 
Set it by code
When open timer interval = 5 seconds
Code:
Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 5000
End Sub
Then on time dispaly message and disable the timer
Code:
Private Sub Form_Timer()
MsgBox "hello"
Me.TimerInterval = 0
End Sub

________________________________________________________________________
Zameer Abdulla
Visit Me
A person who misses a chance and the monkey who misses its branch can't be saved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top