By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,624 Members | 1,747 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,624 IT Pros & Developers. It's quick & easy.

Incorporate/Utilize Built In Search Function

P: 19
I have a form that among other things list the first and last names of customers. I need to add a command button that will allow the user to search on last name. Is there a way to program the command button to utilize Access' built in search feature (i.e. CTRL F) to do this?? If so, how could I just limit the search to 1 field (Last name)?
Apr 6 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,532
Why not simply use <Ctrl> + <F> ? If the cursor is in the last name field that' s the only field that will be searched.

This code will do the same thing from a Command Button

Expand|Select|Wrap|Line Numbers
  1. Private Sub SearchButton_Click()
  2.     Screen.PreviousControl.SetFocus
  3.     DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
  4. End Sub
Linq ;0)>
Apr 7 '10 #2

P: 109
I might be way off but take a look at either of these utilities. I use the first one to search the database for existing clients which I guess is similar to what you are looking for (although it filters the records as opposed to just taking you to a specific record)
Search criteria -
Find as you type -
Apr 7 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.