
Originally Posted by
June7
Yes, it can be coded. Or can use the intrinsic Access tools for search and filter. Click in any field and select Sort or Filter from the ribbon or right click to get sort/filer options or if in Datasheet view click on the field heading to get dropdown.
Coding filter or goto a record on subform is a little trickier than for a main form. But basic concept is same. Use an unboud data control to enter search criteria and set filter property of form. Only for a subform have to go through the subform container, like:
Me.subformcontainername.Form.FilterOn = False
Me.subformcontainername.Form.Filter = "fieldname=" & Me.controlname
Me.subformcontainername.Form.FilterOn = True
What I have on the subform is a command button called search
The code that is in the form propety is
Code:
Private Sub SearchCmd_Click()
On Error GoTo Err_SearchCmd_Click
Screen.PreviousControl.SetFocus
DoCmd.RunCommand acCmdFind
Exit_SearchCmd_Click:
Exit Sub
Err_SearchCmd_Click:
MsgBox Err.Description
Resume Exit_SearchCmd_Click
End Sub
Would I integrate the code you have with that code. (sorry I dont know Visual basic)