Loading a form

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
 
C

Cheryl Fischer

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

DoCmd.OpenForm "frmRegisterArrival"
 
T

TC

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
 

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

Top