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

How to close form??

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
The form pops up a message, I want to close the form even the user don't click on the OK button on the message.

How can I do that?? anybody can help me???
 
Put a timer on it. --------------
A little knowledge is a dangerous thing.
 
Do a search in this form about using the timer control in this forum, it's pretty easy once you get the hang of it and you just have to add code to the timer event to close your form.
 
Hi,

Set The Form Timer Interval to let say 5000 (5 Sec)
and on timer

Docmd.close

Good Luck
 
Hi, all

I have set a timer, but the form can't close.
here is my code, but didn't work. can't close the form if nobody click on the OK button. I need the form close when onbody clik any buttons on the message.

Private Sub Form_load()
Timer2.Enabled = True
If MsgBox("Close the form if you are through! ", vbOKCancel, "Title") = vbYes Then
Unload Me
Else
Exit Sub
End If
End Sub

Private Sub Timer2_Timer()
CloseTime = CloseTime + Timer2.Interval
If (CloseTime > 1000) Then
Unload Me
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top