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.
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.