Trying to use wizard for Find Record Button

P

Piperlynne

I set up a find record button for a form to search items in a table and the
code now looks like this:

Private Sub findrecord_Click()
On Error GoTo Err_findrecord_Click


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

Exit_findrecord_Click:
Exit Sub

Err_findrecord_Click:
MsgBox Err.Description
Resume Exit_findrecord_Click

End Sub

So I have a two part question - I cannot search on a blank record it gives
me an error saying that the primary key is required. I want to be able to put
a value in any field and have it pull up the matching record. Do I need to
get rid of the primary key?

I'm really new to this so any help is appreciated. Should I start over and
create my own button? If so, how do I get it to allow the user to type a
value into any field and search for that?
 

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