Loading a form

  • Thread starter Thread starter richardb
  • Start date Start date
R

richardb

To learn about loading forms, I created a form called
frmTEST and added a button Command0. The click event is
meant to load frmRegisterArrival (see code below).
However, when I try this I get the error "Object
Required". What am I doing wrong?

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Load frmRegisterArrival

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
 
In Access, to open a form, use the following syntax in the click event of
your command button:

DoCmd.OpenForm "frmRegisterArrival"
 
The Load and Unload statements do not apply to Access VBA - even if they are
in online help!

You need the OpenForm statement. Check out OpenForm in online help.

HTH,
TC
 
Back
Top