Using the FindRecord method, the following code in the parent form's module
should find and highlight a row in the subform in a subform control named
sfcCustomers where the LastName value starts with the string entered in the
text box txtName in the parent form.
Dim frm As Form
Set frm = Me.sfcCustomers.Form
Me.sfcCustomers.SetFocus
frm.LastName.SetFocus
DoCmd.FindRecord Me.txtName, acStart
RunCommand acCmdSelectRecord
Personally I'd not have used the FindRecord method, but instead found the
record in a clone of the subform's recordset and then, if a match exists,
synchronized the bookmarks:
Dim frm As Form
Dim rst As Object
Set frm = Me.sfcCustomers.Form
Set rst = frm.Recordset.Clone
With rst
.FindFirst "Lastname Like """ & Me.txtName & "*"""
If Not .NoMatch Then
frm.Bookmark = rst.Bookmark
Me.sfcCustomers.SetFocus
RunCommand acCmdSelectRecord
End If
End With
Ken Sheridan
Stafford, England
Thank you i am sorry I should have said subform that is datasheet view. A
text box in primary form is used to develop a search on partial or full last
name of customer. The row that is found needs hilited not just the one field.
It would be as if I clicked on the row to hilite it. Thank you again.
[quoted text clipped - 6 lines]
Form_Current event you could have a particular field receive focus and
hilight that field every time you move to a different record.