Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MultiSelect listbox as a Parameter in a query (97)

    I have a MultiSelect listbox on my form that has 4 columns(ID, NAME, Version,Price) . If i select more than one row how can I pass the vaules to a query. Does this make sense?
    Thanks
    dgw

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: MultiSelect listbox as a Parameter in a query (97)

    It makes alot of sense; unfortunately I don't think it can be done. You can use it to create a WHERE clause for use in an OpenReport or OpenForm, but not a query.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: MultiSelect listbox as a Parameter in a query (97)

    What you could do is dynamically build the query and use a CreateQueryDef command to create the query.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: MultiSelect listbox as a Parameter in a query (97)

    How about having a temp table (ie. a table that normally has no records) then inserting the values selected from the listbox into the table, and using the values from the table as the parameters for the query?
    e.g. where fieldname in (select * from tbltemp)
    You would also need a delete query to clear the tmep table out again.
    Regards
    John



  5. #5
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MultiSelect listbox as a Parameter in a query (97)


Posting Permissions

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