Command button Help

C

Cathy

I've entered a command button on my form where I want to search the form by
the data field named "GPC." This is the code that is attached to the button.

Private Sub Search_GPC_Click()
On Error GoTo Err_Search_GPC_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Search_GPC_Click:
Exit Sub

Err_Search_GPC_Click:
MsgBox Err.Description
Resume Exit_Search_GPC_Click

End Sub

Unfortunately, when I click the button I get the following error message.

"The expression OnClick you entered as the event property setting produced
the following error: procedure declaration does not match description of
event or procedure having the same name."

I am not very familiar with code. Any help is GREATLY appreciated.
 

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