COMBO BOX - IF/THEN STATEMENTS

  • Thread starter Thread starter childe51
  • Start date Start date
C

childe51

I have a combo box in a form with values pre-entered. Depending on which
value the user pulls in the first combo box, I would like a second combo box
to pop up with secondary values associated with the primary value entered in
the first combo box. Don't know enough VB or any SQL to get this done. This
would be the modern-day equivalent of an if-then statement in Basic (yes,
that's the last programming code I learned).
 
I have a form that is similiar to yours. What I did is create a query for the
2 items (Category and Subcategory, where I only wanted specific subcategories
associated with the cateogory).

The query included only category & subcategory. The criteria for category is:

Iif(isNull([Forms]![FormName]![cboCategory]),[Category],[Forms]![FormNames]!
[cboCategory])

In my form, I named the category combo box cboCategory, using the query as
the row source, column count 1. On the subcategories combo box, the row
source is the same query, column count 2, column widths 0";1", bound column 2.


Hope this helps.
 

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

Back
Top