Reset option group to null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an option group with 5 radio buttons, if at data entry the operator
mistakenly clicks a button yet didn't want any of the 5 then I want to set
the option group back to null, the default. The control is a number, integer.
I would be happy to have a button when clicked sets the control to null.
Thanks.
 
Simply set the frame object that contains the radio buttons to Null, as in:

Me.Frame4 = Null
 
I'm in the same boat, but I'm not sure how to set the frame to null. Is this
so that the user can click off of the options and clear the option box?

Where can one put this code in? Any help is greatly appreciated
 
Hi Sarah,

"Is this so that the user can click off of the options and
clear the option box? "

yes

"Where can one put this code in?"

make a command button and put the code in the [Event
Procedure] for the Onclick event of your command button

there are other places you could put it too, but this may be
easiest for you.

turn on the properties window if it is not showing
from the menu --> View, Properties

ie: make a command button

OTHER tab:
Name --> cmdClearWhatever
ControlTipText --> (ie:) Clear Options

FORMAT tab:
Caption --> X
ForeColor --> DarkRed
Width --> 0.2
Height --> 0.2

EVENT tab:
click in the OnClick event
click the builder button (...) to the right and choose "Code
Builder"

this takes you to a module window between the procedure
declaration (Private Sub cmdClearWhatever_Click() and End Sub)

type Me.

then you will be prompted with control names -- type the
name of the frame control or pick it from the list

then =Null

your statement will end up like this:

'~~~~~~~~~~~
me.controlname = null
'~~~~~~~~~

Whenever you write code, your should ALWAYS compile it
before you attempt to run it.

from the menu: Debug, Compile

fix any errors on the yellow highlighted lines

keep compiling until nothing happens (this is good!)


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Thank you so much! It worked perfectly. I really appreciate your time.

strive4peace" <"strive4peace2006 at yaho said:
Hi Sarah,

"Is this so that the user can click off of the options and
clear the option box? "

yes

"Where can one put this code in?"

make a command button and put the code in the [Event
Procedure] for the Onclick event of your command button

there are other places you could put it too, but this may be
easiest for you.

turn on the properties window if it is not showing
from the menu --> View, Properties

ie: make a command button

OTHER tab:
Name --> cmdClearWhatever
ControlTipText --> (ie:) Clear Options

FORMAT tab:
Caption --> X
ForeColor --> DarkRed
Width --> 0.2
Height --> 0.2

EVENT tab:
click in the OnClick event
click the builder button (...) to the right and choose "Code
Builder"

this takes you to a module window between the procedure
declaration (Private Sub cmdClearWhatever_Click() and End Sub)

type Me.

then you will be prompted with control names -- type the
name of the frame control or pick it from the list

then =Null

your statement will end up like this:

'~~~~~~~~~~~
me.controlname = null
'~~~~~~~~~

Whenever you write code, your should ALWAYS compile it
before you attempt to run it.

from the menu: Debug, Compile

fix any errors on the yellow highlighted lines

keep compiling until nothing happens (this is good!)


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I'm in the same boat, but I'm not sure how to set the frame to null. Is this
so that the user can click off of the options and clear the option box?

Where can one put this code in? Any help is greatly appreciated

:
 
you're welcome, Sarah :) happy to help

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Thank you so much! It worked perfectly. I really appreciate your time.

:

Hi Sarah,

"Is this so that the user can click off of the options and
clear the option box? "

yes

"Where can one put this code in?"

make a command button and put the code in the [Event
Procedure] for the Onclick event of your command button

there are other places you could put it too, but this may be
easiest for you.

turn on the properties window if it is not showing
from the menu --> View, Properties

ie: make a command button

OTHER tab:
Name --> cmdClearWhatever
ControlTipText --> (ie:) Clear Options

FORMAT tab:
Caption --> X
ForeColor --> DarkRed
Width --> 0.2
Height --> 0.2

EVENT tab:
click in the OnClick event
click the builder button (...) to the right and choose "Code
Builder"

this takes you to a module window between the procedure
declaration (Private Sub cmdClearWhatever_Click() and End Sub)

type Me.

then you will be prompted with control names -- type the
name of the frame control or pick it from the list

then =Null

your statement will end up like this:

'~~~~~~~~~~~
me.controlname = null
'~~~~~~~~~

Whenever you write code, your should ALWAYS compile it
before you attempt to run it.

from the menu: Debug, Compile

fix any errors on the yellow highlighted lines

keep compiling until nothing happens (this is good!)


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I'm in the same boat, but I'm not sure how to set the frame to null. Is this
so that the user can click off of the options and clear the option box?

Where can one put this code in? Any help is greatly appreciated

:



Great, thank you.
--
Doug F.


:



Simply set the frame object that contains the radio buttons to Null, as in:

Me.Frame4 = Null



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)




I have an option group with 5 radio buttons, if at data entry the operator
mistakenly clicks a button yet didn't want any of the 5 then I want to set
the option group back to null, the default. The control is a number,

integer.


I would be happy to have a button when clicked sets the control to null.
Thanks.
 
Back
Top