Forum Discussion

STM's avatar
STM
Copper Contributor
Mar 21, 2025

Populating Comb Box With Multiple Values

I have an Access table with a Regions field and a States Field. The States Field is populated with one to twenty state abbreviations depending on the region. Using VBA, I'd like to populate the Regions combo box with the appropriate regions depending on what state is chosen in the State combo box. The problem I have is that some states are included in more than one region. For example, 'WY' is part of the Great Basin, Northern Rockies, and Rocky Mountain regions. 'NV' is part of the Great Basin and Northern California regions. In order for multiple regions to be populated in my Regions combo box (ie. Great Basin, Northern Rockies, and Rocky Mountain if a user selects 'WY' in the States combo box), is there some sort of VBA dictionary I could set up (much like in Python) to iterate through and select out the appropriate regions? Or if that's not possible, would I have to set up some sort of array and use a For Loop to select out the appropriate regions?

 

Region_NameStates
AlaskaAK
Eastern AreaME, NH, VT, MA, CT, RI, NY, NJ, DE, PA, MD, WV, OH, MI, IN, IL, WI, MN, IA, MO
Great BasinAZ, ID, NV, UT, WY
Northern RockiesID, MT, ND, SD, WY
NorthwestWA, OR, HI
Northern CaliforniaCA, NV
Southern CaliforniaCA
Rocky MountainCO, KS, NE, SD, WY
Southern AreaTX, OK, AR, LA, MS, AL, TN, KY, VA, NC, SC, GA, FL, PR
SouthwestAZ, NM

 

Any advice would be greatly appreciated. 

3 Replies

  • XPS35's avatar
    XPS35
    Iron Contributor

    Your design is not right. Never store multiple values in one field. You need three tables here: Region, State and StateInRegion. Like:

    Part of your data will look like:

     

    • STM's avatar
      STM
      Copper Contributor

      Ok, thank you very much!

      • arnel_gp's avatar
        arnel_gp
        Iron Contributor

        there are only 58 states so no need to super normalized your table, 1 table is enough.

        open state table then open form1.

        regional.accdb

Resources