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

  • Thread starter Thread starter JC Barry
  • Start date Start date
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.
 
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"......
 
Back
Top