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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.FindRecord method. Please Help. 1

Status
Not open for further replies.

Voga

Technical User
Apr 30, 2003
28
US
Hi all. Thank you for visiting my thread. I need help.
I open Access database from Excel form. How to make access.Application.DoCmd.FindRecord method to look for a record in specified field ONLY? In my case this is "lastname" field. How to specify this field in the following string that I tried and what its order of arguments:

Dim MySearch As String

MySearch = txtLName.Text
......
access.Application.DoCmd.FindRecord MySearch, acStart, True, acSearchAll, True, acAll, True

'this is what I have now. It's searching the record at all directions which I don't need. Where in the string above I can specify my "lastname" so it would perform the search only in "lastname" field?

Thank you
 
You could use the access.Application.DoCmd.GoToControl "lastname"
and then alter your Find command not to search in allFields, but in the current field only. I cannot tell exactly by heart now, but it should be your acAll option. Turn this to acCurrent....

Hope this helps,
MakeItSo
 
MakeItSo
It's working!
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top