Filter by selection in code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Karl Irvin

    #1

    Filter by selection in code

    When looking at a table etc, you can highlight a few characters in a field
    and click the Filter by Selection button and the table is filtered by these
    characters.

    Can you mimic this process in code? I need for users to be able to highlight
    a few characters in a form data sheet and then click a button to check a box
    on what would be the filter results ( I don't need it to filter the records,
    just check those that match.)

    So if you have

    James
    Jones
    Johnson

    and the user highights Jo and clicks a button, he gets

    James
    Jones x
    Johnson x

    Using A2000



  • Granny Spitz via AccessMonster.com

    #2
    Re: Filter by selection in code

    Karl Irvin wrote:
    Can you mimic this process in code? I need for users to be able to highlight
    a few characters in a form data sheet and then click a button to check a box
    on what would be the filter results
    Not by clicking a button on the form because as soon as the text box loses
    focus the selected text in the text box is no longer selected. You can use
    the text box's mouse up event like this:

    Dim sFilter As String

    sFilter = Me!txtLastName. SelText
    Me!lstList.RowS ource = "SELECT LastName FROM qryEmps WHERE LastName LIKE
    '" & sFilter & "*'"
    Me!lstList.Requ ery

    The results would show up in the list box, lstList.

    --
    Message posted via AccessMonster.c om


    Comment

    Working...