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