Loop through selection boxes and execute a task

I attached a very basic database that has two combo boxes that are populated by querying specific criteria in a table.  The first combo box is Me.cboZone, the second combo box is Me.cboArea.  Me.cboZone must be selected first to generate a list of options for Me.cboArea to select.

Currently, I select the first option in Me.cboZone. Then I individually select all the corresponding options in Me.cboArea that are associated with what’s displayed in Me.cboZone to execute a given task.

So the manual steps would look something like this in my database:

For Me.cboZone select the first record which is: ‘Atlantic’.  Then for Me.cboArea select the first record which is ‘MD’ and perform task (e.g. MsgBox “Task complete”).  Next for Me.cboArea select the next record and perform task.  Then keep select all the applicable records in Me.cboArea until the end, then select the second record in Me.cboZone, and do the same thing all over again until complete.

There has to be a block of code that could automate this process, but I’m not strong enough with loops to put it together.  I’d really appreciate a solution for this.
Database2-.accdb
KP_SoCalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
see if this is what you are looking for
Database2-Rev.accdb
0
KP_SoCalAuthor Commented:
Hi Capricorn, sorry it has taken so long to respond.  I've been away for most of the day.  The code you provided is super close to what I need.  However, instead of looping through like:

Atlantic
MD
NJ


I would need it to loop through like this:

Altantic
MD


Then...

Altantic
NJ


You'll see I added some code that forces it to display in the combo box field each loop since the values listed in the combo box fields are tied to obects: "Query1" and "repDaily".

Thanks again for your help on this! I attached my revised database.  ;-)
Database2-Rev2.accdb
0
Rey Obrero (Capricorn1)Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KP_SoCalAuthor Commented:
Absolutely outstanding!  Thanks again so much!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.