Incorporate/Utilize Built In Search Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dieselrocks
    New Member
    • Mar 2009
    • 19

    Incorporate/Utilize Built In Search Function

    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)?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    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

    Code:
    Private Sub SearchButton_Click()
        Screen.PreviousControl.SetFocus
        DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
    End Sub
    Linq ;0)>

    Comment

    • hedges98
      New Member
      • Oct 2009
      • 109

      #3
      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

      Comment

      Working...