Unselecting button options

G

Guest

I created an option group, but it's not always used for each record.
However, if one accidentally "selects" one of the options, and then wants to
clear it, how do they "de-select" any option? It's easy to select a
different option, but if you don't want any of them what do you do? Is it
necessary to create a "none" option for this, or is there a better way?

K -
 
F

fredg

I created an option group, but it's not always used for each record.
However, if one accidentally "selects" one of the options, and then wants to
clear it, how do they "de-select" any option? It's easy to select a
different option, but if you don't want any of them what do you do? Is it
necessary to create a "none" option for this, or is there a better way?

K -

Simplest to just add one more button.
If you need 3 buttons, add a fourth:

Code the OptionGroup AfterUpdate event:

If Me!OptionGroupName = 1 Then
Do this
ElseIf Me!OptionGroupName = 2 Then
Do that
ElseIf Me!OptionGroupName = 3 Then
Do something else
ElseIf Me!OptionGroupName = 4 Then
Me!OptionGroupName = Null
End if

You could also code a command button click event:
Me!OptionGroupName = Null
 
G

Guest

First why wouldn't you lock the option group in those cases when you don't
need to update the option group

If you want to clear the selection, then either create another option that
equal 0 - none, or create a button next to the option group, that say clear
and assign a value of 0 to the group. me.groupname=0
 
G

Guest

Thanks for the suggestion. How do I lock the option group if it's not
needed? My other post from today "Option group within another option group"
describes what I'm trying to do. I'd like to have it locked except when
needed and maybe that would take care of it. Thanks for any info.

K -
 
G

Guest

If you dont need to use the option group for each record, then on the on
current event of the form enter the code

if ReasonToLock=true then
me.optionGroupName.lock=true
end if

but if the reason can change becase of a value you enter in one of the
fields the on the after update event of the field enter the code.
 

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