Activate another field off of drop down list

G

Guest

Hi all..

I have a two drop down list on a form (populated from another table that
is linked to main table).

Drop Down List #1
Fireworks
Illegal Fireworks
Etc

Drop Down List #2
Fireworks General
M-80
Bottle Rockets
Etc

I would like to have it setup if the end user selects Illegal Fireworks in
drop down list #1, Drop Down List #2 would activate so you could select the
appropiate one. I would also like if they select Fireworks from drop down
list #1, drop down list #2 would also activate.

I have this code, but it doesn't allow to pick 1 of the drop downs:
If Me.PaveAssociated = True Then
Me.PaveNumber.Enabled = True
Else
Me.PaveNumber.Enabled = False
End If
End Sub

How can I get this to work?

Thanks
R~
 
G

Guest

Rhett,
assuming "Illegal Fireworks" is your 2nd selection in your listbox#1, you
can add this code to the ListBox1 afterUpdate event:

Private Sub List1_AfterUpdate()
If List1.ListIndex = "1" Then //user selected Illegal Fireworks
List2.Visible = True
Else
List2.Visible = False
End If
End Sub

-toco-
 
G

Guest

Cool I will try that out and post back...Now would I do that for all of
them.. Say it is the third one...fith one etc... would I just change the "1"
portion to match?? If so where would I put it in at??

thanks
R~
 
G

Guest

If you will evaluate the 3rd, 5th, 6th, ect., ect., I would suggest doing a
Case statement:

Private Sub List1_AfterUpdate()Case 1 //selected Illegal fireworks
ListBox2.Visible = True
Case 2 //selected something else
ListBox2.Visable = False
End Select
 

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