By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,671 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,671 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


missinglinq
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

100+
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 - http://allenbrowne.com/ser-62.html
Find as you type - http://allenbrowne.com/AppFindAsUType.html
Apr 7 '10 #3

Post your reply

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