Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Only One Field on a Form...

Status
Not open for further replies.

SherryLynn

Technical User
Feb 4, 2001
171
CA
I have a form which has a couple of subforms linked to it. How can I set up a Search function to search only one of the fields on the form rather than every field on the form?
 
Set your focus to the subform.
Set your focus to the field in question.
Use the Find Record command limiting the current field.


SubFormName.SetFocus
FieldName.SetFocus

DoCmd.FindRecord strText, acAnywhere, , acSearchAll, , acCurrent
'This DoCmd is all one line

strText is a string variable that you determine from an input box or something. It's what you will be looking for in the field.

The constant acCurrent is what will limit your search to what every field you set the focus to.

Hope this helps B-)

ljprodev@yahoo.com
ProDev
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top