Combobox Comboboxes Visible Based on More then one selection

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
 
S

Stuart McCall

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

Ben Pelech

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

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