Hi,
I am failry new to this game and could use some help. Is there an easier
way..?
I get an integer fields from the database indiacting the access rights of a
user and I wish to display that on a Windows Form as a group of radio
buttons. Any cnages made to this group should filert back to the database.
I am using Dataset (using stored procedure) to retrieve the data and
objCmd.ExecuteNonQuery to save it back to DB.
Code Snipets to check radio button and the get selected button back:
' Now load radio button
If _UserRole.Rows(0).Item("AccessRights") = 0 Then
RadioBtnAllAccess.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 1 Then
RadioBtnForecastAndReports.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 2 Then
RadioBtnReportsOnly.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 9 Then
RadioBtnNoAccess.Checked = True
End If
-----------------------------------------
' Now get the selected radio button
If RadioBtnAllAccess.Checked Then
Label1.Text = "You selected " & RadioBtnAllAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 0
ElseIf RadioBtnForecastAndReports.Checked Then
Label1.Text = "You selected " & RadioBtnForecastAndReports.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 1
ElseIf RadioBtnReportsOnly.Checked Then
Label1.Text = "You selected " & RadioBtnReportsOnly.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 2
Else
Label1.Text = "You selected " & RadioBtnNoAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 9
End If
Many thanks ,
Thomas 2 1869
What exactly is your question?
"tangokilo" <tk******@ozemail.com.au> wrote in message
news:UN***************@nnrp1.ozemail.com.au... Hi, I am failry new to this game and could use some help. Is there an easier way..?
I get an integer fields from the database indiacting the access rights of
a user and I wish to display that on a Windows Form as a group of radio buttons. Any cnages made to this group should filert back to the
database. I am using Dataset (using stored procedure) to retrieve the data and objCmd.ExecuteNonQuery to save it back to DB.
Code Snipets to check radio button and the get selected button back: ' Now load radio button
If _UserRole.Rows(0).Item("AccessRights") = 0 Then
RadioBtnAllAccess.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 1 Then
RadioBtnForecastAndReports.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 2 Then
RadioBtnReportsOnly.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 9 Then
RadioBtnNoAccess.Checked = True
End If
-----------------------------------------
' Now get the selected radio button
If RadioBtnAllAccess.Checked Then
Label1.Text = "You selected " & RadioBtnAllAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 0
ElseIf RadioBtnForecastAndReports.Checked Then
Label1.Text = "You selected " & RadioBtnForecastAndReports.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 1
ElseIf RadioBtnReportsOnly.Checked Then
Label1.Text = "You selected " & RadioBtnReportsOnly.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 2
Else
Label1.Text = "You selected " & RadioBtnNoAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 9
End If
Many thanks , Thomas
What exactly is your question?
"tangokilo" <tk******@ozemail.com.au> wrote in message
news:UN***************@nnrp1.ozemail.com.au... Hi, I am failry new to this game and could use some help. Is there an easier way..?
I get an integer fields from the database indiacting the access rights of
a user and I wish to display that on a Windows Form as a group of radio buttons. Any cnages made to this group should filert back to the
database. I am using Dataset (using stored procedure) to retrieve the data and objCmd.ExecuteNonQuery to save it back to DB.
Code Snipets to check radio button and the get selected button back: ' Now load radio button
If _UserRole.Rows(0).Item("AccessRights") = 0 Then
RadioBtnAllAccess.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 1 Then
RadioBtnForecastAndReports.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 2 Then
RadioBtnReportsOnly.Checked = True
ElseIf _UserRole.Rows(0).Item("AccessRights") = 9 Then
RadioBtnNoAccess.Checked = True
End If
-----------------------------------------
' Now get the selected radio button
If RadioBtnAllAccess.Checked Then
Label1.Text = "You selected " & RadioBtnAllAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 0
ElseIf RadioBtnForecastAndReports.Checked Then
Label1.Text = "You selected " & RadioBtnForecastAndReports.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 1
ElseIf RadioBtnReportsOnly.Checked Then
Label1.Text = "You selected " & RadioBtnReportsOnly.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 2
Else
Label1.Text = "You selected " & RadioBtnNoAccess.Text
objcmd.Parameters.Add("@AccessRights", SqlDbType.Int).Value = 9
End If
Many thanks , Thomas
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rick |
last post by:
After being frustrated with this issue on several occasions I think I
found the secret sauce for solving the issue after reading a few
different messages about what others thought and trying a...
|
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
...
|
by: Rage Matrix |
last post by:
Hi all,
I have a small problem with Access radio button groups in VBA. I've got a
radio button group called fraSearchMode with three radio buttons in it. At a
certain point, I want to see which...
|
by: Scott D Johnson |
last post by:
I am using Visual Studio .NET 2003 (I also have VS .NET 2005 installed)
I have a group of four radio buttons, and button, to set the first radio
button as checked. When I run the app, and say...
|
by: Sin Jeong-hun |
last post by:
Suppose there are 4 radion buttons on the form. There's no groupbox or
panel to seperate them. By default, the 4 radio buttons are mutually
exclusive. Is it possible to group them into two groups?...
|
by: teddysnips |
last post by:
Back in the dim mists of antiquity I used to program in VBA for
Microsoft Access (hey, don't knock it - very useful tool for the right
application).
This had a really handy control in the...
|
by: liltwese |
last post by:
Hi, i'm new to VB. I have a problem with de-selecting radio buttons in group box containers. I've tried to set focus to other objects under Sub New (initialization) but it didn't work. The rdo...
|
by: moksha |
last post by:
Hi,
I am new to javascript and i am facing a problem in coding.
plz help me out.
I am using javascript for dynamically creating a table row which contains text boxes and radio...
|
by: axapta |
last post by:
Hi group,
How can I group a couple of check boxes on my form so that only ONE can be
checked an anytime?
I've tried placing them onto a panel but I can still check them both.
Using VB.NET...
|
by: DragonLord |
last post by:
Ok here is the situation in detail.
Single form with multiple items on it, 4 of which are panls that contain radio butons. Each panel loads it's radio buttons from a list of items in a sql...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
|
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...
|
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,...
| |