Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to open a form, error messages 1

Status
Not open for further replies.

elviajero

MIS
Feb 8, 2001
40
0
0
US
I have the following code on a command button that opens a form:

Private Sub Delete_Location_Click()
On Error GoTo Err_Delete_Location_Click

DoCmd.OpenForm "frm_LocDel", acNormal, , , acFormDel

Exit_Delete_Location_Click:
Exit Sub

Err_Delete_Location_Click:
MsgBox Err.Description
Resume Exit_Delete_Location_Click

End Sub

and within the form itself I have

Private Sub Form_Open()
DoCmd.Maximize
DoCmd.GoToRecord , , acFirst
End Sub

If I try to hit the command button to open the form, I get:

The OpenForm action was cancelled. You used a method of the DoCmd object to carry out an action in Visual Basic but then clicked Cancel in a dialog box.

If I try to open the form in normal view directly from the Forms tab in Access, I get:

The expression On Open you entered as the event property setting produced the following error: Event procedure declaration does not match description of event having the same name. The expression may not result in the name of a macro, the name of a user-defined function or [Event Procedure]. There may have been an error evaluation the function, event, or macro.

Any ideas would be most appreciated.
 
Here is an idea. Open the form in code view and compile all code. Click 'Debug', then 'Compile All Modules'. This may reveal what is causing the problem.

Gary
gwinn7
 
He's correct. You will reveal the problem through Compile Loaded Modules. Quite often the problem resides in code completely unrelated to the field you suspect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top