Form Timer

  • Thread starter Thread starter Secret Squirrel
  • Start date Start date
S

Secret Squirrel

I have a command button my form that I use to save the record along with
sending an email at the same time when the button is pressed. How can I have
it also pop up a message saying "Email being sent...Please wait" and have
that message box stay open for 10 seconds?
 
Create a form that has a label on it with the message you want.

Set the form's TimerInterval property to 10,000

In the form's Timer event, put code to close the form.

Open the form using

DoCmd.OpenForm "MyMessageForm", acNormal, , , , acDialog
 
Hi Doug,
I assume I open this code in the "On Click" event of my command button,
correct?

SS
 
Hi Mr quirrel

Say you have a form called FrmWait and you open it from another form

In the 1st form (the one with the button) put this OnClick (change ButtonName)

Private Sub ButtonName_Click()
'Open form with timer event close to tell staff not to do anything'
DoCmd.OpenForm "FrmWait", acNormal, "", "", , acNormal


In FrmWait put this is the timer interval to 10000 (add this into Timer
Interval row)
and put this OnTimer

Private Sub Form_Timer()
DoCmd.Close
End Sub
 
Yes, you'd use the OpenForm wherever you had previously been thinking of
putting MsgBox.
 

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

Back
Top