473,378 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Question about Radio Buttons


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
3 3036

"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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked ...
5
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the...
1
by: Brian Henry | last post by:
In standard VB.NET you can group radio buttons in a pannel or frame and when you click on one in that frame or pannel the others will update relative to the selection so only the one you picked is...
1
by: Jay | last post by:
I need to validate 21 sets of radio buttons before submission to the server for calculation and storage. Is it best to validate on the client side using javascript or to validate on the server...
3
by: Ken Varn | last post by:
This is probably a simple question, but I am new to this so bear with me. I have a ASP.NET form that has a checkbox and a 2 radio buttons. When the checkbox is checked, the 2 radio buttons are...
3
by: Ferret Face | last post by:
Hello, I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
7
by: nathaniel.k.lee | last post by:
Is it not possible, in IE, to dynamically click a radio button? I'm grabbing some values from a database and using them to populate radio buttons on a page. I have alternate code for Firefox...
12
html on wheels
by: html on wheels | last post by:
Greeting sports fans. In order to ask multiple questions and not have your radio buttons jump from one question to the next, what do you type to create a break between them. I am trying to complete a...
3
by: SAM | last post by:
ll a écrit : <script type="text/javascript"> function checkform( f ) // f is the form to check { var txt1 = 'Please make a selection for the Learning Outcome :', txt2 = '\nYour...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.