Combobox Comboboxes Visible Based on More then one selection

Combobox Comboboxes Visible Based on More then one selection

Post by QmVuIFBlbG » Thu, 31 Jul 2008 10:45:00


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
 
 
 

Combobox Comboboxes Visible Based on More then one selection

Post by Stuart McC » Thu, 31 Jul 2008 12:26:12


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")

 
 
 

Combobox Comboboxes Visible Based on More then one selection

Post by QmVuIFBlbG » Fri, 01 Aug 2008 08:50:06

Works great!! Thanks