Hello,
I created an automatic pop-up form that appears when opening the database, and in it a button that refers to a query.
When I click the button appears the message -
"The expression On Click you entered as the event property setting producted the followinng error: Ambiguous name detected: YourButton_Click"
The query itself works well without the referral from the button on the form.
The VB file:
Private Sub Command2_Click ()
On Error GoTo Err_Command2_Click
Dim stDocName As String
stDocName = "LayersAll"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub