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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option group buttons locked or disabled unless value in txt box 2

Status
Not open for further replies.

tech84

Technical User
May 18, 2000
126
US
I've got a form with some option groups containing three option buttons each. My user has a question about what to do if she accidentally selects one of these option buttons in a group that should not have a button selected. The only thing I can figure is that I have to come up with a way to make the option buttons locked or disabled until a value is entered into the text box that corresponds with each option group. Is there a way to do this? I've searched the Help files and these posts and have had no luck. The Help files mention vaguely how to do this with a macro, but I can't figure out how to associate the macro with the form. I know a little VBA, but have never worked with macros.

Any help will be greatly appreicated!

Thanks,

Mike
[morning]
 
Hi!

Yes, but most of us avoid macros too;-)

I think using both the after update event of the textcontrol assosiated with the option group, and the on current event of the form might do the thrick, testing for a value in the text control.

[tt]Me!fraMyOptionGroup.Enabled = Not IsNull(Me!txtBox.Value)[/tt]

Where fraMyOptionGroup is the name of your option group, txtBox the name of your text control.

Roy-Vidar
 

One other thing I have done with option groups is include a command button that clear it:

new command button.

OnClick:

[optiongroupfield]=null

 
Thanks to both of you! I like both methods, but my user opted for the buttons. Users always like buttons, don't they? :eek:)

You both get stars! Thanks again...

Mike
[morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top