create a querry using the multiselection function on a listbox

Discussion in 'Microsoft Access VBA Modules' started by John N, Apr 3, 2008.

  1. John N

    John N Guest

    I am trying to create a query in Microsoft Access using the multi selection
    function on the list box to filter the data in a query. When I refer back to
    the list box in the query it does not return any information. When I reset
    the parameters of the list back to none in the mutli select property it works
    however it does not when I have it set to Extended.

    What can I do to have this work?
     
    John N, Apr 3, 2008
    #1
    1. Advertisements

  2. John N

    Allen Browne Guest

    A query cannot directly read multiple selections from a list box.

    It is possible to write code that loops through the ItemsSelected collection
    of the list box, to build a Filter string to use in a form or report. Here's
    an example:
    Use a multi-select list box to filter a report
    at:
    http://allenbrowne.com/ser-50.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "John N" <John > wrote in message
    news:...
    >I am trying to create a query in Microsoft Access using the multi selection
    > function on the list box to filter the data in a query. When I refer back
    > to
    > the list box in the query it does not return any information. When I
    > reset
    > the parameters of the list back to none in the mutli select property it
    > works
    > however it does not when I have it set to Extended.
    >
    > What can I do to have this work?
     
    Allen Browne, Apr 3, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick

    passing a parameter to a querry using VBA code

    Patrick, Nov 24, 2003, in forum: Microsoft Access VBA Modules
    Replies:
    3
    Views:
    413
    Patrick
    Nov 25, 2003
  2. Mario

    How to insert "Manual Line Break" in querry results.

    Mario, Jun 7, 2004, in forum: Microsoft Access VBA Modules
    Replies:
    3
    Views:
    1,297
    Duane Hookom
    Jun 8, 2004
  3. Mario

    How to insert "Manual Line Break" in querry results.

    Mario, Jun 7, 2004, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    230
  4. Guest

    Creating TXT files based upon a Querry

    Guest, Feb 21, 2006, in forum: Microsoft Access VBA Modules
    Replies:
    2
    Views:
    165
    John Nurick
    Feb 21, 2006
  5. Guest

    Saving querry results in vba

    Guest, Oct 6, 2007, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    168
    Allen Browne
    Oct 6, 2007
Loading...

Share This Page