Hey guys, I have a form, and a command button. The command button opens the standard find dialog box. I want it to go to the first record, and then it searches the last name record field in the form, and when it finds it go to that form record (I don't want it to go to the actual db, I want it to work from the forms). Right now when i click the button I get an error that says....
The control 'lastnamesearch' the macro is attempting to search can't be searched.
Try one of the following:
Add a GoToControl action before the FindRecord action.
For the FindRecord action, change the Only Current Field action argument from Yes to No.
Change the focus to a searchable controls.
But I'm a n00b and I'm not sure what to do.... here is my code for that function..
The control 'lastnamesearch' the macro is attempting to search can't be searched.
Try one of the following:
Add a GoToControl action before the FindRecord action.
For the FindRecord action, change the Only Current Field action argument from Yes to No.
Change the focus to a searchable controls.
But I'm a n00b and I'm not sure what to do.... here is my code for that function..
Code:
Private Sub lastnamesearch__Click()
On Error GoTo Err_lastnamesearch__Click
DoCmd.GoToRecord , , acFirst
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_lastnamesearch__Click:
Exit Sub
Err_lastnamesearch__Click:
MsgBox Err.Description
Resume Exit_lastnamesearch__Click
End Sub