Results 1 to 2 of 2
  1. #1
    beebop83 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3

    How do I use multiple list selections from form in query criteria?

    I'm working on an old database for someone at work, and there's a report that they need to run and they need to specify a start date and end date, and then they will choose several departments and the report should display information for any entry between the start and end date that is also one of the selected departments. The dates aren't an issue, I can get that data from either a form, or by prompting for the start/end date. Getting the report to work when multiple departments are selected from a list however has been a huge pain. I've tried to use the IN command in my query and then reference the items selected from the list on the form IN (N'Forms![MultiDepartment_Lookup]![mySelection]') and that hasn't worked.



    I've also tried to make a VBA module that took the data selected in the list and constructed an SQL query that was stored in a variable which was used by a function, and then i tried to use the function in my query parameter, and that hasn't worked either. Does anyone have an suggestions?

  2. #2
    beebop83 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3
    Ok, I think I'm making progress. I've got the following command and I've debugged it so that I don't get any errors, but when I enter the information on the form and click the Ok button, the circle spins for a few seconds while it does some computing, but then the report I want to display doesn't actually show up. Anybody have any suggestions?

    DoCmd.OpenReport "CaseNoSummaryListing", acViewPreview, , "[Location] IN ( " & StrWhere & ") AND [DateOfEvent] >= (" & start & ") AND ([DateOfEvent] >= (" & enddt & ")", acWindowNormal

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

Similar Threads

  1. Replies: 1
    Last Post: 10-19-2014, 11:31 PM
  2. Replies: 2
    Last Post: 01-24-2014, 02:26 AM
  3. Handling Multiple Selections in a List Box
    By Zetony in forum Access
    Replies: 2
    Last Post: 11-02-2011, 02:21 PM
  4. Replies: 2
    Last Post: 05-27-2011, 08:12 AM
  5. Multiple Selections from a List Box
    By oleBucky in forum Forms
    Replies: 4
    Last Post: 05-06-2011, 08:24 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