|
-
Nov 2nd, 2000, 11:00 AM
#1
Thread Starter
New Member
I'm fairly new to VB and decided I wanted to experiment with the checkbox control. Problem, I have three check box’s in a control array. I want to select one (checkbox1(X%).value = 1) and have the other two
checkbox(X%).value = 0 . This part works OK, it could be better, however the real problem is getting the
1 or 0 into the database. I’m using a simple DAO control and can’t get it to work. I get a type mis-match.
Here’s my code BLUSH)
Private Sub Check1_Click(Index As Integer)
For X% = 0 To 2
Y% = X% + 1
If Y% = 3 Then Y% = 0
Z% = Y% + 1
If Z% = 3 Then Z% = 0
If Check1(X%).Value = 1 Then Check1(Y%).Value = 0
If Check1(X%).Value = 1 Then Check1(Z%).Value = 0
Next X%
Data1.Refresh
Data1.Recordset.AddNew
End Sub
-
Nov 2nd, 2000, 11:16 AM
#2
Frenzied Member
check for value
Code:
if check1(idx).value = 0 then
'send the word FALSE into db
else
'send word TRUE into db
end if
-
Nov 2nd, 2000, 11:21 AM
#3
Lively Member
You really ought to be using radio buttons for this. They will automatically ensure that only one of the buttons is selected at any given time.
If you need more than one group of radio buttons, enclose each group in a frame of its own for independance.
You can then sequence through each of the buttons in a loop, setting the appropriate field n the database table to TRUE or FALSE as submitted by kovan.
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
|