Combo Box Populating

B

b_a_redman

I have two fields on a table, called Type1 and Type2. I created a form based
upon these fields and i need help in what i want to do. On this form i have
two combo boxes, combo1 and combo2. From combo1 i want to be able to select a
value, and upon doing this, combo2 will be populated with specific data based
on what i selected.

Combo1 Combo2
Scouting Beavers
Cubs

Guiding Rainbows
Brownies

So as shown above, if i select Scouting from combo1, i only want Beavers and
Cubs to appear in combo2. If i select Guiding, then i only want Rainbows and
Browines to be in the combo box. I need validationa swell, so combo1 must be
selected first before combo2 is populated. I need help please. I need
information as to how i do this, i need the code if someone can do it for me
because i have no knowledge at all, i have tried wedsites and they are not
helping me at all.
 
A

AccessVandal via AccessMonster.com

Hi,

It is better to normalize your table. You need two tables to do this.

Table1
Field1
Scouting
Guiding

Table2
Field1 Field2
Scouting Beavers
Scouting Cubs
Guiding Rainbows
Guiding Brownies

In combo1, the Rowsource = Table1 or use a query
In combo2, the Rowsource = just leave it blank or use a query like

Select Field2 From Table2 Where Field1 = Ԡ& Me.Combo1 & “’â€

In the combo1, afterupdate event input this

Me.Combo2.RowSource = Select Field2 From Table2 Where Field1 = Ԡ& Me.Combo1
& “’â€
Me.Combo2.Requery

In the Current event of the form, input this

Me.Combo2.Requery

The combo boxes must be bound to the control source if you want it as a
record.

You can refer to this site for a beginner “Cascading Lists for AccessFormsâ€
http://www.fontstuff.com/access/acctut10.htm
 

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