Results 1 to 4 of 4
  1. #1
    lovenigma is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    3

    Help using list boxes in Access to pass values to a query

    Hi everyone,

    I am working on a database that should have been done yesterday, haha. But I'm having some implementation issues that I'm stumped on!

    I am using a form with three list boxes and three checkboxes so that a user can select the criteria that is sent to a query. The list allows for one criteria, while the checkbox (if checked) overrides the list box and returns all the options for that criteria.

    I successfully implemented it for ONE criteria. But for the other two, it is prompting me for input when the query is ran. It appears as if the list box works correctly, but the checkbox is not.

    The code that works correctly, which is placed in the query's criteria box, is:
    [Forms]![Run Query Form]![SelectPlant] Or IIf([Forms]![Run Query Form]![AllPlants]=True,[Plant]![Plant_name],"")
    But for the other criteria, it prompts the portion of the IIF function that says [Plant]![Plant_name]. I'm aware that this is how the brackets should work, but it works correctly in the first criteria and not the others!

    Here's the database:
    (My work proxy is blocking the attachment feature. Argh. Please use this link instead! I promise it's not malicious.) http://dl.dropbox.com/u/11833099/Sup...Management.zip


    I'd appreciate ANY and ALL help. Or, if there's a different and easy way I could implement the same functionality. I'm amazed it's not included in Access already! (In a user-friendly format)

    Thanks a ton!!

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

    Help using list boxes in Access to pass values to a query

    [Plant]![Plant_name] is not fully qualified as the earlier two cases.

    If [plant] is a sub-form then you must qualify that [Forms]![Run Query Form]![Plant].form![Plant_name]



  3. #3
    lovenigma is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    3
    Okay that seems to be on the right track. But, the data I'm trying to pull from is actually a table. What would be the syntax in that case?
    [Table]![Positions]![Pos_name] maybe?

  4. #4
    lovenigma is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    3
    On second thought, that isn't working. And the list box the DOES work correctly is pulling the data from a table with only [Plant][Plant_name]

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

Similar Threads

  1. HELP! using list boxes with multiselect
    By tarhim47 in forum Forms
    Replies: 21
    Last Post: 11-08-2010, 02:51 PM
  2. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  3. List Boxes.
    By Willtc in forum Programming
    Replies: 2
    Last Post: 02-12-2010, 04:12 AM
  4. Pass list as parameter to in operator
    By bliever in forum Queries
    Replies: 5
    Last Post: 11-11-2009, 03:15 AM
  5. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM

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