Option Button to Enable List Box

  • Thread starter Thread starter HServ
  • Start date Start date
I have two option buttons on a form. I want the second one to enable a list
box when it is clicked. Right now all I can do is say Yes or No to Enable in
the Properties box.

Example -- O View All
O View by Category

(ListBox) Category: Arts ^
Sports |
Teens V

So when you click "View by Category" you can choose from the list but when
you click "View All" you can't choose from the listbox, because you are
going to see them all anyway.
Thanks
 
Assuming that the two option buttons are part of an option group frame (I'll
assume the option group is named fraOptions), use the AfterUpdate event of
the frame (option group) to set the enabled property of the listbox:

Private Sub fraOptions_AfterUpdate()
Me.ListBoxName.Enabled = (Me.fraOptions.Value = 1)
End Sub

The above assumes that the value of the "View All" option button is 1.
--

Ken Snell
<MS ACCESS MVP>
 

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

Back
Top