Combobox Comboboxes Visible Based on More then one selection

  • Thread starter Thread starter Ben Pelech
  • Start date Start date
B

Ben Pelech

Hello,

I have some combo boxes that I only want visible based on certain selections
in another combobox. I have no problem using Me.Type_of_Vendor.Visible =
(Me.Type_of_Contact = "Mojo Ticket"), and it works perfectly. My problem is
that I need this combo box to be visible when Mojo Ticket is chosen, as well
as Vendor Calls. I am not sure how to join these two in one statement. I
have tried adding an OR in there, but that didnt work. These are all in my
afterupdate field. Below is what I have in there so far.

Private Sub Type_of_Contact_AfterUpdate()
Me.TransferredTo.Visible = (Me.Type_of_Contact = "Transferred")
Me.Type_of_Vendor.Visible = (Me.Type_of_Contact = "Mojo Ticket")
Me.Type_of_Vendor.Visible = (Me.Type_of_Contact = "Vendor Calls")

End Sub

Any help would be greatly appreciated.

Thanks
Ben
 
Ben Pelech said:
Hello,

I have some combo boxes that I only want visible based on certain
selections
in another combobox. I have no problem using Me.Type_of_Vendor.Visible =
(Me.Type_of_Contact = "Mojo Ticket"), and it works perfectly. My problem
is
that I need this combo box to be visible when Mojo Ticket is chosen, as
well
as Vendor Calls. I am not sure how to join these two in one statement. I
have tried adding an OR in there, but that didnt work. These are all in
my
afterupdate field. Below is what I have in there so far.

Private Sub Type_of_Contact_AfterUpdate()
Me.TransferredTo.Visible = (Me.Type_of_Contact = "Transferred")
Me.Type_of_Vendor.Visible = (Me.Type_of_Contact = "Mojo Ticket")
Me.Type_of_Vendor.Visible = (Me.Type_of_Contact = "Vendor Calls")

End Sub

Any help would be greatly appreciated.

Thanks
Ben

When you say "I need this combo box to be visible when Mojo Ticket is
chosen, as well as Vendor Calls", the phrase "as well as" translates to AND.
But Me.Type_of_Contact cannot be both values at once, just one OR the other,
therefore your code ought to look like:

Me.Type_of_Vendor.Visible = _
(Me.Type_of_Contact = "Mojo Ticket") Or _
(Me.Type_of_Contact = "Vendor Calls")
 
Works great!! Thanks

Stuart McCall said:
When you say "I need this combo box to be visible when Mojo Ticket is
chosen, as well as Vendor Calls", the phrase "as well as" translates to AND.
But Me.Type_of_Contact cannot be both values at once, just one OR the other,
therefore your code ought to look like:

Me.Type_of_Vendor.Visible = _
(Me.Type_of_Contact = "Mojo Ticket") Or _
(Me.Type_of_Contact = "Vendor Calls")
 
Back
Top