473,809 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3066

"TORQUE" <To****@home.or g> wrote in message
news:ia******** *************** *********@4ax.c om...

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.En abled = True
Case conDisable
Me!cmdDelete.En able = False
End Select

Jeff
May 4 '06 #2
On Thu, 4 May 2006 16:25:44 +1200, "Jeff Smith" <No****@Not.Thi s.Address> wrote:

"TORQUE" <To****@home.or g> 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.En abled = True
Case conDisable
Me!cmdDelete.En able = 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.or g> wrote in message
news:ut******** *************** *********@4ax.c om...
On Thu, 4 May 2006 16:25:44 +1200, "Jeff Smith" <No****@Not.Thi s.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_AfterU pdate()
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.En abled = True
Case conDisable
Me!cmdDelete.En able = 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
3296
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 The problem i am facing is that i do not know how many yes/no radio groups will be generated
5
3112
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 user clicks on the "Choose" button of the input field (to select a file on the local disk), then radio button B is automatically
1
1559
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 selected, how do you do this similary in ASP.net? I know there is a radio group but what about a single radio button? how would you do it with a couple single radio buttons like you can in VB.net.. thanks
1
1610
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 using the code behind vbscript. It seems that natural to validate before submission. If javascript is the best then how do I the variables. I noticed some javascript that was dynamically created which looks like the following: ...
3
1661
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 enabled using javascript. When the checkbox is unchecked, the 2 radio button are disabled with javascript. Here is the problem that I am seeing. When I submit the form with the radio buttons disabled, the form returns with both radio buttons...
3
2481
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 possibility of multiple selections. However, one item is "None of the above" and I have placed some logic (autopostback, etc.) that will remove all previous selections if "None of the above" is chosen. My problem is this: This list of Radio Buttons...
2
11987
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 them each in a GroupBox. All the examples I saw from the books or from the web show me how to add static radio buttons at design, or dynamically at run time but with fixed radio buttons (like from an array). I need to create radio buttons based...
7
2534
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 browsers using the setAttribute() function. Everything works as planned in Firefox but in IE, the buttons won't populate and, what's worse, I can't even click on them after everything loads. I see the slight shadow that indicates you're clicking on a...
12
2549
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 user document but the radio buttons do not function per each individual sentence. Instead, all of the radio buttons are linked up. I could write the code if anybody is still confused about my question as I am finding it hard to explain this. In...
3
1125
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 favorite Ice Cream flavor is a required field.'+ '\nPlease try again.'
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10375
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.