Results 1 to 6 of 6
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Question Combobox value as query criteria

    I have a Company combobox and Contact combobox. The RowSource for my Contact dropdown is all contacts. However, if a company is selected I want the Contact dropdown to only show the Contacts at that company. I have the correct syntax for this critiera that I added to my query:



    Code:
    [Forms]![F_QUOTE]![cmbCompany]
    But how do I deal with no value selected in the Company combo? I want it to go back to showing all Contacts...I just can't figure it out.

  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,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Thanks, that helps. But what if a Company is selected? Then I want it to narrow down the options.. Basically, the criteria should apply at this point.

  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,521
    That technique should show all records if nothing is selected, restricted to the selected value if something is selected. Do you have a Requery in the after update event of the first combo?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Awesome! Yes, I just needed to requery the Contact dropdown after the Company is changed! Thank you sooo much!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo!
    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. Replies: 1
    Last Post: 07-13-2011, 11:00 AM
  2. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  3. Query criteria retrieved from a Form combobox?
    By blacksaibot in forum Queries
    Replies: 1
    Last Post: 01-27-2010, 10:18 AM
  4. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  5. Criteria from Combobox dont work.
    By Ryan in forum Queries
    Replies: 3
    Last Post: 08-31-2009, 07:09 AM

Tags for this Thread

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