Msgbox to appear after form loads?

  • Thread starter abdul wahab via AccessMonster.com
  • Start date
A

abdul wahab via AccessMonster.com

hello all,

i have a form which I have set so that it opens a blank record once opened.
After it has been opened I want a msgbox to appear. my code so far is:

---------------------------------------
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec

Select Case MsgBox("Please select the Registration Number from the drop
down menu or type it in", vbOKOnly, "Select Registration Number")

End Select
End Sub
-------------------------------------------



but the problem is that the msgbox appears before the form is opened.

any ideas how to fix this would be grately appreciated. thank you
 
J

Jason

Unless I'm mistaken, all calls inside the on_load even will happen prior to
displaying the form. Another option is to place the code in the location
that opens the form. This could be done from another form:
Private Sub btnOpenForm2_Click()
DoCmd.OpenForm "Form2"
MsgBox(parameters)
End Sub

Or something similar.
 
A

abdul wahab via AccessMonster.com

thanks for the replies Jason and RickB.
Jason, I tried your suggestion and it worked a treat! Thank you very much
 
Top