Results 1 to 4 of 4
  1. #1
    joesmithjunior is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    4

    Search Combo Box


    Hello,
    I have a database that keeps track of customers by last name, first name and various other information. I have the combo box setup so that I can type in a last name and it brings up my results. The problem is that it only brings up the first match and doesnt let me browse through all the matches. The last name and first name are seperate fields so if I look for a last name that more than one customer has like smith it only takes me to the first match. Is there any way to make it filter all the names that arent matches out of the combo box as the values are typed in?

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by joesmithjunior View Post
    Hello,
    I have a database that keeps track of customers by last name, first name and various other information. I have the combo box setup so that I can type in a last name and it brings up my results. The problem is that it only brings up the first match and doesnt let me browse through all the matches. The last name and first name are seperate fields so if I look for a last name that more than one customer has like smith it only takes me to the first match. Is there any way to make it filter all the names that arent matches out of the combo box as the values are typed in?
    post the code you use to do the search

  3. #3
    joesmithjunior is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    4
    I'm not using any code. I just used the combobox wizard and used option 3 to set it up to search

  4. #4
    joesmithjunior is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    4
    Nevermind. Here is the code

    Private Sub txtSearch_AfterUpdate()
    With Me.RecordsetClone
    .FindFirst "[FirstName]=""" & Me.txtSearch & """ OR [Lastname]=""" & Me.txtSearch & """"
    If .NoMatch Then
    Beep
    Else
    Me.Bookmark = .Bookmark
    End If
    End With
    End Sub

    Private Sub Combo1254_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[ID] = " & Str(Nz(Me![Combo1254], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

    Private Sub Combo1256_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CUST] = '" & Me![Combo1256] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using a combo box as search method
    By jbethann in forum Programming
    Replies: 3
    Last Post: 10-20-2011, 09:21 AM
  2. Replies: 4
    Last Post: 08-16-2011, 05:54 PM
  3. search as you type in combo box
    By pratim09 in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 07:46 AM
  4. Search Combo box malfunction
    By babak.nourani in forum Forms
    Replies: 7
    Last Post: 01-20-2011, 07:37 PM
  5. Help with a search feature or combo box
    By jmanis in forum Forms
    Replies: 14
    Last Post: 07-06-2010, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums