Results 1 to 4 of 4
  1. #1
    Remillard is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Kelowna, British Columba
    Posts
    14

    Pass Combo box info to query

    I'm a fairly new user to Access so don't have a grasp of what, I'm sure, are some pretty basic query constructs. Here's what I have and am trying to do.

    - Table with staff information including if they've received training (yes/no box) and what city they work in.
    - Form with combo box to choose which staff in which city to display their training status.
    - Query displays results based on city choice

    This works fine when a specific city is chosen from the combo box but I would like an "ALL" choice in the combo box to display all staff from all cities. I thought it might be a second query criteria in the city field something like: If [Forms]![Expiry]![City] = "All" then.... and I get lost at that point. LOL!



    Thanks in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Remillard is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Kelowna, British Columba
    Posts
    14
    pbaldy, again you come to my aid. I'm very appreciative of the support.
    Interestingly, in the first link you gave was this query code:
    [Forms]![myForm]![myControl] OR [Forms]![myForm]![myControl] Is Null

    It occurred to me, why wouldn't "All' work instead of "Null". Well sure enough, it does! Cleaner than having to combine.
    Thanks much for pointing me in the right direction. Again, I have some scripting knowledge (powershell) but I know next to nothing about the language and structure of Access and VBA.
    I've got a few more queries to create so I have a feeling I'll be making a new post in this area shortly!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Display different info based combo box
    By cactuspete13 in forum Reports
    Replies: 12
    Last Post: 01-22-2013, 08:14 PM
  2. Read form info, pass to VB script... lost
    By enragedcow in forum Forms
    Replies: 4
    Last Post: 08-28-2012, 01:11 PM
  3. Update Combo Box after entering new info
    By justgeig in forum Programming
    Replies: 13
    Last Post: 06-07-2012, 04:24 PM
  4. How can I pass the value from a combo box to listbox
    By robertdbuckley in forum Programming
    Replies: 1
    Last Post: 05-24-2012, 08:43 AM
  5. Replies: 8
    Last Post: 04-21-2010, 06:43 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