By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,145 Members | 1,624 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,145 IT Pros & Developers. It's quick & easy.

Question about Radio Buttons

P: n/a

Hi

How can I make a radio button create an action like enabling or disabling a delete button in a form?

TIA
TORQUE
May 4 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"TORQUE" <To****@home.org> wrote in message
news:ia********************************@4ax.com...

Hi

How can I make a radio button create an action like enabling or disabling
a delete button in a form?

TIA
TORQUE


If you have two radio buttons inside an option group you can use this
example. I've named a few controls for you to follow the code

Option Group Name: fraGroup
Button Names: optEnable, optDisable
Command Button: cmdDelete

In the AfterUpdate event of the option group "fraGroup", use the following
code:

Const conEnable As Integer = 1 ' Or the option value of the optEnable
radio button
Const conDisable As Integer = 2 ' Or the option value of the optDisable
radio button

Select Case Me!fraGroup
Case conEnable
Me!cmdDelete.Enabled = True
Case conDisable
Me!cmdDelete.Enable = False
End Select

Jeff
May 4 '06 #2

P: n/a
On Thu, 4 May 2006 16:25:44 +1200, "Jeff Smith" <No****@Not.This.Address> wrote:

"TORQUE" <To****@home.org> wrote in message
news:ia********************************@4ax.com.. .

Hi

How can I make a radio button create an action like enabling or disabling
a delete button in a form?

TIA
TORQUE


If you have two radio buttons inside an option group you can use this
example. I've named a few controls for you to follow the code

Option Group Name: fraGroup
Button Names: optEnable, optDisable
Command Button: cmdDelete

In the AfterUpdate event of the option group "fraGroup", use the following
code:

Const conEnable As Integer = 1 ' Or the option value of the optEnable
radio button
Const conDisable As Integer = 2 ' Or the option value of the optDisable
radio button

Select Case Me!fraGroup
Case conEnable
Me!cmdDelete.Enabled = True
Case conDisable
Me!cmdDelete.Enable = False
End Select

Jeff


Hi Jeff,

Thanks for your help, but, It does not seem to work for me. I have tried it
following along exactly as you have it in the paragraph above.
I dont know ?

Any other suggestions?

TIA
TORQUE
May 5 '06 #3

P: n/a

"TORQUE" <To****@home.org> wrote in message
news:ut********************************@4ax.com...
On Thu, 4 May 2006 16:25:44 +1200, "Jeff Smith" <No****@Not.This.Address>
wrote:
Hi Jeff,

Thanks for your help, but, It does not seem to work for me. I have tried
it
following along exactly as you have it in the paragraph above.
I dont know ?

Any other suggestions?

TIA
TORQUE


The complete sub routine should be

Private Sub fraGroup_AfterUpdate()
Const conEnable As Integer = 1 ' The option value of the optEnable
radio button
Const conDisable As Integer = 2 ' The option value of the optDisable
radio button
Select Case Me!fraGroup
Case conEnable
Me!cmdDelete.Enabled = True
Case conDisable
Me!cmdDelete.Enable = False
End Select
End Sub

Did you create the radio buttons using the Option Group control on the
Toolbox toolbar? To turn on the Toolbox menubar, go to the view menu and
select Toolbox. Make sure that the Control Wizards are turned on by clicking
the second icon on the toolbar. Then select the Option Group icon, the one
with a square and has xyz on its top, and follow the instructions. When
you're finished with the wizards, name the group frame to fraGroup (or
whatever you want but change the fraGroup in the code to the name you used)
and the buttons to optEnable and optDisable where each has an option value
of 1 and 2 respectively. Make sure that your delete button is named
cmdDelete. Click on the option group frame and in the AfterUpdate event
paste the code above. Before you try to see if it works, go to Debug and
select Compile. Nothing will be highlighted if there's no errors.

Jeff
May 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.