Hide/Unhide a Control depending on selection from a Combo Box

J

JC Barry

I am creating a database for a library. I need to know how
to unhide a control when two certain selections are made
from a Combo Box.

Example: When "Article" or "Periocial" is selected in the
Combo Box, the control "Box Location" needs to become
visible.
 
W

Wayne Morgan

The question here is, what is the value of the combo box? It will depend on which column
is the bound column. If the text you mention (i.e. Article) isn't in the bound column, you
will either have to use the associated value of the bound column or you will need to use
the column property to check the text.

In the AfterUpdate event of the combo box:

If Me.cboMyCombo = "Article" Or Me.cboMyCombo = "Periodical" Then
Me.[Box Location].Visible = True
Else
Me.[Box Location].Visible = False
End If

You would change the first line above if you need to refer to a different column:

If Me.cboMyCombo.Column(1) = "Article"......
 

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