+ Reply to Thread
Results 1 to 5 of 5

frm with 2 combo box's

  1. #1
    Forum Contributor
    Join Date
    04-16-2020
    Location
    Alberta, Canada
    MS-Off Ver
    365
    Posts
    216

    frm with 2 combo box's

    I have a form (frmStamps) with two combo box's in the form header

    1. CountryCombo
    2. CityCombo (which is linked to the CountryCombo so I only see Cities in that Country)



    My query has:
    Country Criteria as: [Forms]![frmStamps]![CountryCombo]
    City Criteria as: IIf([Forms]![frmStamps]![CityCombo]="", ([tblStamps].[City]) Like "*",[Forms]![frmStamps]![CityCombo])

    I want it to show all the cities if the CityCombo is blank (no selection), but filter if there is a CityCombo selection.


    is this something that would be better done in VBA or is there some other way? I tried to do the OR method but it didn't work

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: frm with 2 combo box's

    lot easier to give suitable solution with a workbook.

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: frm with 2 combo box's

    I would change the City Criteria to:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    04-16-2020
    Location
    Alberta, Canada
    MS-Off Ver
    365
    Posts
    216

    Re: frm with 2 combo box's

    I just did it in VBA and applied it as filters.

    the way it works with the code below is, if no boxes are checked, all options are shown but as soon as you check a box, only that option is shown... and if more than one box is checked all of those options are shown.


    HTML Code: 

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: frm with 2 combo box's

    A bit more convoluted, but if you are happy then all is well in the forest.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using Multiple Combo Box Values to populate a cell (Excluding blank combo boxes)
    By mnadamn19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2016, 08:38 PM
  2. [SOLVED] Using Multiple Combo Box Values to populate a cell (Excluding blank combo boxes)
    By mnadamn19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2016, 10:49 AM
  3. Using Multiple Combo Box Values to populate a cell (Excluding blank combo boxes)
    By mnadamn19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2016, 03:45 PM
  4. Replies: 19
    Last Post: 09-06-2014, 06:30 PM
  5. Populate 2nd combo with alpha based on 1st combo with 2 columns of numeric codes
    By dovermac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2014, 10:09 AM
  6. Replies: 8
    Last Post: 12-26-2013, 02:23 PM
  7. [SOLVED] Excel 2010 VBA – Combo Box Options– Clear cell/box in 2nd Combo when 1st Combo selected
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2013, 07:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1