"grayed out" options on userform...


Posted by rm on December 30, 2001 7:58 PM

Hello,

I have put a userform in my workbook that allows a user opening it to enter new information on a worksheet via the userform. I would like to know how to have a certain section of that userform "grayed out" (user cannot select options), but made available based on certain selections made from a listbox on the form.

Example: In a drop-down list box a user will select from list "NRFT", "SEFT", and "MUPT". There are a set of optionbuttons on the userform which have been put within a frame. I would like the optionbuttons located within that frame grayed out by default (user can't input anything). But if user selects "SEFT" from the list box, then the area is no longer grayed out, and optionbuttons are now able to select--(because this section is only relevant to "SEFT", but not the other options). Hope this made sense...thanks...rm

Posted by Tom Dickinson on December 30, 2001 8:22 PM

Re: "grayed out" 2 methods

Two different methods:

Turn the "Locked" property to "TRUE". This will keep the object visable, but not allow any interaction.

The other method would be to turn the object property "Visible" to "FALSE". This will hide the object entirely (which may help in minimizing a user's confusion).

You can turn these on or off at the time a selection is made (ListBox1_Change), but don't forget to reverse the action (like when the listbox is re-entered).

Posted by rm on December 30, 2001 9:05 PM

...thank you Tom...but doesn't achieve what I wanted...

...happy new year...rm

Posted by Ivan F Moala on December 30, 2001 9:12 PM

Re: ...thank you Tom...but doesn't achieve what I wanted...

RM

you need to set the enabled property of the optionbox.....set this to false @ load time
or just by setting them to false by default
in you setup.
Then enable them when your condition is met eg

If ..... then Optionbox1.enabled = true

etc

Ivan



Posted by rm on December 31, 2001 6:27 PM

...thanks Ivan...

...that's the ticket...rm