Popup Form + Messagebox

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Does anyone know of a way to open a messagebox over a popup form opened in
acDialog mode?

Thanks for any ideas!

Steve
 
Ken,

Thanks for replying!

You missed my question!

MsgBox "Whatever"
DoCmd.OpenForm "MyForm",,,,,acDialog

In the above code, the message box has to close before MyForm opens.

DoCmd.OpenForm "MyForm",,,,,acDialog
MsgBox "Whatever"

In this code, MyForm has to either become not visible or close before the
messagebox opens.

I'm looking for a way to have them both open at the same time.

Steve
 
Steve,
Depends when do you need them. If you want them to be opened from somewhere else, simply use the timer event of the pop-up and use a switch after the first opening of the message box (hidden text box on the form that would store a boolean showing that the message has been displayed or a variable declared on the Form_Load event). If you do anything on the pop-up first, just use the apropriate event of the control tha has (or loses) the focus.
 
Ken,

Thanks for replying!

You missed my question!

MsgBox "Whatever"
DoCmd.OpenForm "MyForm",,,,,acDialog

In the above code, the message box has to close before MyForm opens.

DoCmd.OpenForm "MyForm",,,,,acDialog
MsgBox "Whatever"

You could try

Private Sub Form_Load()
Me.Visible = True
MsgBox "blah"
End Sub

in the form module.
 
You're right...I didn't understand that this was what you wanted to do.

Open the MsgBox from the Dialog form, not from the calling form. As Lyle
suggests, you can do this in the dialog form's OnLoad event; or you can use
the dialog form's OnOpen event.
 
Back
Top