2nd cbo visibility based on 1st cbo

J

Junior

I want to make a 2nd cbo not visible, except when
the 1st cbo selection is ''ABC"
Where (cbos and form) do i need to have code to be sure the 2nd cbo remains
not visible, except in the case of the ABC selection in cbo1?
and would appreciate some help with the code
 
P

PC Datasheet

Put the following code in the OnCurrent event of your form:
If Me!NameOfFirstCombobox = "ABC" Then
Me!NameOfSecondCombobox.Visible = True
Else
Me!NameOfSecondCombobox.Visible = False
End If
 
M

Marshall Barton

Junior said:
I want to make a 2nd cbo not visible, except when
the 1st cbo selection is ''ABC"
Where (cbos and form) do i need to have code to be sure the 2nd cbo remains
not visible, except in the case of the ABC selection in cbo1?
and would appreciate some help with the code.


Use cbo1's AfterUpdate event:

Me.cb02.Visible = (Me.cbo1 = "ABC")

If the form'srecord source can return more than a single
record, you'll also want the same line of code in the form's
Current event procrfue.
 
P

PC Datasheet

I concur with Marshall that you also need code in the Afterupdate event of the
first combobox. Either code suggested will work.
 

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