Change Drop Down List Based on Check Boxes

G

Guest

I have two check boxes, Status and Type, that I want to use as criteria to
change the drop down box of a combo box on the same form.

There are three different scenarios:
Status = True And Type = True - drop down shows only part list 1
Status = False And Type = True - drop down shows only part list 2
Type = False - drop down shows only part list 3

How would I set this up? Thanks in Advance.
 
G

Guest

Put your lists in a table, with an ID for each list you want to be able to
show.

Pick an applicable event ( click should work ) for the checkboxes, then 3 if
statements checking your conditions. Whenever one of your conditions is met,
set the appropriate SQL in the rowsource property of the combobox.

Something in the nature of:

Me.Combo26.RowSource = "SELECT TEST.Field1 FROM test WHERE (((TEST.Field1) =
1))"
 
G

Guest

Actually, you would need to use the AFTER UPDATE event of the checkboxes
because at the CLICK event the value of the checkbox hasn't updated yet and
the old value will still be valid. So, for instance if your checkbox is
false and you click the checkbox and then have code to check the value in the
ON Click event you would see that the value would still be false, but in the
After Update event it would be shown as True.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
G

Guest

Click event worked perfectly in the sample form I made, and is returning
identical results as afterupdate. The mousedown function is acting in the
manner you described though.
 
G

Guest

I used this following on the afterupdate event of the check boxes and the
gotfocus of the combobox. I added the gotfocus event because I had the form
set as continuous so the user select one check box and then go to a different
combobox and get the wrong input.

Me.RawPart.RowSource = "SELECT PartList.Part FROM PartList WHERE
(((PartList.Status) = Data.Status) AND ((PartList.Type) = Data.Type))"
 

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

Similar Threads

List Box Problem 2
report and drop down list? 4
Create validation rule. 3
Connecting combo boxes 1
Drop Down in Form View 3
Drop down boxes 1
Drop Down List Position on Form 2
Combo List Drop Down Arrow 2

Top