473,403 Members | 2,338 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,403 software developers and data experts.

Option Buttons in VB.NET

PM
I have a question about option buttons and their values.

I have many option buttons on my forms, each set contained in their own
group boxes.

I simply want to be able to give them a value, which can be returned to a
single field in my database.

For example, if I have a group box with 5 option buttons, I want each to
have a value. (0, 1, 2, 3, 4). The first one would send a value of '0' to
the appropriate field in the database, the second one would send a 1 instead,
and so on.

Does anyone know how to do this, and send it back to the database? I'm
really stuck.

Thanks
PM
Aug 24 '05 #1
2 2194
If you are using the desinger and a typed dataset, you can just specify the
datasource in the DataBindings property of the properties window. Set the
dataset, datatable and field value. However this won't do exactly what you
want, it will simply bind it to a field. If you want to send back different
values to the same field, trap the checkChanged event and then set the
field's value from there depending on which radiobutton was chekced.
"PM" <PM@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
I have a question about option buttons and their values.

I have many option buttons on my forms, each set contained in their own
group boxes.

I simply want to be able to give them a value, which can be returned to a
single field in my database.

For example, if I have a group box with 5 option buttons, I want each to
have a value. (0, 1, 2, 3, 4). The first one would send a value of '0' to
the appropriate field in the database, the second one would send a 1
instead,
and so on.

Does anyone know how to do this, and send it back to the database? I'm
really stuck.

Thanks
PM

Aug 24 '05 #2
PM,

For this is the tag from every control very useful.
Simply fill in that the value.
As string it is than
button1.tag.toString
As integer
Cint(button1.tag)

I hope this helps,

Cor
Aug 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
5
by: Georges Heinesch | last post by:
Hi. I created an option group using the wizard. I included 3 option buttons. An option group (in general) can be enabled or disabled completely (includung option buttons and their respective...
11
by: MLH | last post by:
Why is that? If I choose the tiny check boxes which are hard to hit with a mouse, it works fine. But option buttions, shich can be sized big enough for people with limited sight and dexterity...
5
by: tsnyder | last post by:
I need to have an option button that allows editing to a field only when it is checked.
1
by: Stephen D Cook | last post by:
What I am trying to do is have a set of option buttons which are required to click one. If the person doesn't click any before insert, they get an error. If they do click one, it inserts into the...
1
by: Stephen D Cook | last post by:
In my form I have an option group with 3 option buttons. My form is tied to a table. the options are Temp, Permanent and Overtime. I have these inside a frame. I have an AddRecord button to enter...
0
by: sparks | last post by:
I was using the keypress with an option group If Me.ActiveControl.ControlType = acOptionGroup Then If KeyAscii >= 48 And KeyAscii <= 51 Then Me.ActiveControl.Value = Chr(KeyAscii) End If End...
1
by: ahmed222too | last post by:
how to use the option buttons in VBA (how to call the value of the option buttons ) and is it must to gather the option buttons in one option group ? thanks
1
beacon
by: beacon | last post by:
Hi everybody, I've searched around for answers, but the closest thing I've found referenced the Northwind database and it seems to be set up a little differently than mine. I'm using DAPs (data...
2
beacon
by: beacon | last post by:
Hi everybody, I have a form that has a combo box that asks the user to select the program they work on. Once the user selects the program, a SQL statement populates the row source for 4 staff...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.