New to coding -Need to choose table based upon Input

D

dab1477

I'm a complete novice to VBA. This is my first project in
VBA. Thanks in advance for your help.

I want a combo box to populate with a different list based
upon the input of another combo box.

Ex. If box A enters "Line 2" I want box C to populate
from a table with Line 2 reasons, but not Line 3 or Line 4
reasons.

So far I've done the following:

I've created a form with a combo box (Box A) labeled "Work
Center". The combo box allows me to choose from 15
different work centers. This box feeds a master table to
collect a variety of data from within the form. I created
separate tables to populate a combo box labeled "Downtime"
(Box C). When I enter "Line 2" into Box A, I want to
choose a listing from table "Line 2 downtime reasons". If
I enter "Line 3" into Box A, I want Box C to only allow me
to choose from a table with Line 3 downtime reason
listings.

How do I get started? I know that it will contain an
After_Update statement with and ElseIf function. Please
get me started.
 
S

Sandra Daigle

This is a matter of synchronizing combo boxes - basically that's a fancy way
of saying that you make the rowsource of the second combo dependant on the
value of the first combo. To do this you also use the AfterUpdate event of
the first combo to requery the second.

Here's a KB article that describes how to synchronize two combos - post back
if you need more help or further explanation.

ACC: How to Synchronize Two Combo Boxes on a Form (97624)
http://support.microsoft.com/default.aspx?scid=kb;[LN];97624
 
D

dab1477

Sandra,
Thanks again. I think I understand what is required. I
have the article in hand and will attempt to synchronize.
-----Original Message-----
This is a matter of synchronizing combo boxes - basically that's a fancy way
of saying that you make the rowsource of the second combo dependant on the
value of the first combo. To do this you also use the AfterUpdate event of
the first combo to requery the second.

Here's a KB article that describes how to synchronize two combos - post back
if you need more help or further explanation.

ACC: How to Synchronize Two Combo Boxes on a Form (97624)
http://support.microsoft.com/default.aspx?scid=kb; [LN];97624

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

I'm a complete novice to VBA. This is my first project in
VBA. Thanks in advance for your help.

I want a combo box to populate with a different list based
upon the input of another combo box.

Ex. If box A enters "Line 2" I want box C to populate
from a table with Line 2 reasons, but not Line 3 or Line 4
reasons.

So far I've done the following:

I've created a form with a combo box (Box A) labeled "Work
Center". The combo box allows me to choose from 15
different work centers. This box feeds a master table to
collect a variety of data from within the form. I created
separate tables to populate a combo box labeled "Downtime"
(Box C). When I enter "Line 2" into Box A, I want to
choose a listing from table "Line 2 downtime reasons". If
I enter "Line 3" into Box A, I want Box C to only allow me
to choose from a table with Line 3 downtime reason
listings.

How do I get started? I know that it will contain an
After_Update statement with and ElseIf function. Please
get me started.

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top