2nd cbo visibility based on 1st cbo

  • Thread starter Thread starter Junior
  • Start date Start date
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
 
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
 
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.
 
I concur with Marshall that you also need code in the Afterupdate event of the
first combobox. Either code suggested will work.
 
Back
Top