|
-
Dec 4th, 2003, 03:40 PM
#1
Thread Starter
Hyperactive Member
Which radio button is checked?
I am submitting some data to the database. For the most part it is all text box entry. However I have one field that requires the user to select one of three locations.
I thought the easiest way to do this would be to create an option group with all three entries and then just grab the value of the Option Group at the time of submission.
I have since found out that it is not that easy, unless I am missing something obvious. I have done a search on this forum but was more confused afterwards.
I have an option group named gbLocationSelection with three choices:
Control Name - radGR : Text - (Grand Rapds)
Control Name - radKZ : Text - (Kamalamzoo)
Control Name - radTC : Text - (Traverse City)
I just want to get the text name to a string so I can put it in the database. Any ideas?
-
Dec 4th, 2003, 05:50 PM
#2
Addicted Member
Can't you just use "Select Case"
Then just associate the string with the appropriate case
-
Dec 4th, 2003, 10:52 PM
#3
Sleep mode
try this method . It's more easier and shorter than Select Case and resuable too .
VB Code:
Private Sub ChkRbState()
Dim c As New Control
For Each c In Me.Controls
If TypeOf c Is RadioButton Then
If DirectCast(c, RadioButton).Checked = True Then
MessageBox.Show(c.Text())
End If
End If
Next
End Sub
-
Dec 4th, 2003, 10:53 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|