Hiding Combo boxes in code

J

jimmy

Hi, I'm fairly new to Access, and I was wondering if
anyone could help.

I have a combo box from which I choose the county a
customer lives in. There is a choice of three counties.

I have written some code which changed the background
color depending on what is selected. As follows.

Private Sub Combo92_GotFocus()
If Combo92 = "6CT_BERKS" Then
Detail.BackColor = 13434828
End If
If Combo92 = "4CT_OXON" Then
Detail.BackColor = 7369724
End If
If Combo92 = "7CT_BUCKS" Then
Detail.BackColor = 16427894
End If
End Sub

There are three other combo boxes, each giving the option
of a town relevant to that county which was just selected.

Is there any way, once the county has been selected, to
hide the two town combo boxes I don't need, and only
display the one related to that county.

Thanks.
 
T

Tony Wainwright

Yes just set the visible property to false in the AfterUpdate event
Me.Combo92.Visible = False
Tony
 

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