Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get more than 20 options in an option box? 3

Status
Not open for further replies.

Hawimatidasa

Instructor
Jul 14, 2004
11
I am creating an option box so that when a person clicks on one of the options, a list box on the form is populated with info based upon their choice. As I was entering in the names of the choices in the Option Goup Wizard, I was told that I can only have 20 options. As luck would have it, I need 26 options. Is there a way to get around this limitation?

Thanks in advance!
 
maybe use a combo box instead?
or use 2 option groups w/ 13 options each

- RoppeTech
 
Hi,

Unsure how you would have 26 option buttons, but as an alternative why not use a list box and use the OnClick even to populate your second list box (or even a combo box).

The advantage of doing it this way would be that if you ever needed to add or remove items then you wouldn't have to redesign your whole form....

Andrew
 
Hi,
Although it is not advised to use too many option buttons on a form to make it cluttered, You can have more than 20
create 20 by wizard then pick single option button from the tool bar paste on the form
right click > Cut > Click on the frame > right click > Paste
Your 21st option value will be -1 change it to 21 then another one....
afryer's suggestion is best I believe.
regards

Zameer Abdulla
 
Thanks guys!

I know that 26 options is a bit much for an option box, but I know the VBA code to refresh a listbox from the selection made in an option group. I will probably go with the suggestions to use a combo box instead and will just hunt the VBA code down that I need to get the desired response. The can't can't be THAT much different - can it?!

Appreciate the help.

Jeff
 
It'll actually be a lot easier than coding 26 separate events - all you need is one event, i.e MyCombo_Click () and you can determine from there what has been selected using the following:

Code:
Sub MyCombo_Click ()
    dim l_result as Integer
    l_Result = MyCombo.Column(0)

    msgbox "You selected " & l_Result
end sub

Andrew
 
afryer,

Thanks for the code! The form works smooth as silk now. Many thanks.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top