Access has me flummoxed again (nothing new in that). I added menu buttons to
a form using the command button wizard on the tool bar. They worked fine.
You can see the "onclick" event under "Dipslide Add Record" below.
Then when I went to a second form, accessing a different table, and tried to
add the same button all I got was an error message to the screen. I did
exactly the same thing, used the command button on the tool bar, for exactly
the same purpose for the button but the onclick event is shown below under
"Inventory Add Record." I have gone in and out of the programme, reset the
button but still get the same error to the screen when I click on it.
The error reads: "The expression On Click you entered as the event property
setting produced the following error: Ambiguous name detected:
SaveInventoryRecord_Click. *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 evaluating the function, event or macro.)
Help would be appreciated. Thank you.
*******************************
Dipslide Add Record:
*******************************
(Button name "New Record Button.")
Private Sub NewRecordButton_Click()
On Error GoTo Err_NewRecordButton_Click
DoCmd.GoToRecord , , acNewRec
Exit_NewRecordButton_Click:
Exit Sub
Err_NewRecordButton_Click:
MsgBox Err.Description
Resume Exit_NewRecordButton_Click
End Sub
********************************
Inventory Add Record:
********************************
(Button name "Add Record.")
Err_Command219_Click:
MsgBox Err.Description
Resume Exit_Command219_Click
End Sub
Private Sub AddRecord_Click()
On Error GoTo Err_AddRecord_Click
DoCmd.GoToRecord , , acNewRec
Exit_AddRecord_Click:
Exit Sub
Err_AddRecord_Click:
MsgBox Err.Description
Resume Exit_AddRecord_Click
End Sub