Results 1 to 5 of 5

Thread: search criteria

  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Unanswered: search criteria

    Hi to one and all This is my first post here.. I hope that you can help me I am developing a database The database needs to list the records in a listbox and then when a record is clicked the details come up, The problem i have is I need a method for getting/filtering all the records that begin with First character into the listbox. I have 27 command buttons listed down the page from A-Z, when one is clicked the listbox needs to filter the Full name that begin with that letter
    Any pointers or help would be much appreciated ACCESS 2010

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Every button could call a procedure like:
    Code:
    Private Sub SortForm(Byval FirstLetter As String)
    
        If Len(FirstLetter) > 0 Then
            strFilter = "SomeField LIKE '" & FirstLetter & "*'"
            Me.Filter = strFilter
            Me.FilterOn = True
        Else
            Me.FilterOn = False
        End If
    
    End Sub
    It's very difficult to be more specific without knowing anything about your database.
    Have a nice day!

  3. #3
    Join Date
    Jan 2012
    Posts
    4

    Re search

    What I am trying to achieve is instead of using a dropdown box all The time. Is when you click a button i.e 'P' just the Artists name appears in a list box or the dropdown box. Because when I have finished updating the records The dropdown box way is going to be to long to scroll. I am enclosing Database to see if you understand me And thank you for your reply

  4. #4
    Join Date
    Jan 2012
    Posts
    4

    database

    The database Music_Access2010.zip

  5. #5
    Join Date
    Jan 2012
    Posts
    4
    problem solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •