Before using made find button how can i make it so a field is selected

John11

New member
Local time
Yesterday, 20:48
Joined
Apr 10, 2005
Messages
9
I've just created a search button (action chosen through wizard was find record) that works fine, however I am wanting to made the button do more things.

The goal of the search button is to find a customers name. Currently to do that I have to click on the sub-form fsubListyear7, and click on the surname field then click the search button in order for the search to work properly. Is there anyway i could get the buton to do that for me.

This is currently what the button performs:
Code:
Private Sub cmdSearchy7_Click()
On Error GoTo Err_cmdSearchy7_Click


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

Exit_cmdSearchy7_Click:
    Exit Sub

Err_cmdSearch_Click:
    MsgBox Err.Description
    Resume Exit_cmdSearchy7_Click
    
End Sub
Anyone know what i should enter for it to select Surname of fsubListyear7 before showing the 'find' window?

Thanks
 
There may be better ways of doing what you want, but this should work to bring up the Find dialogue...
Code:
Me.fsubListYear7.form.[Surname].setfocus
DoCmd.RunCommand acCmdFind
 

Users who are viewing this thread

Back
Top Bottom