Basically, I have an array of option buttons (radio buttons) and I want to loop through them to see which one is selected, then insert that value into the database (where the field name is TOPICS) The code is as follows :
Dim X
For X = 0 To Me.optCategory.Count - 1
Select Case optCategory(X).Value
Case optCategory(0).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "SOFTWARE"
Case optCategory(1).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "MPG"
Case optCategory(2).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "ACE"
Case optCategory(3).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "V2500"
Case optCategory(4).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "JT8D"
Case optCategory(5).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "JT9D"
Case optCategory(6).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "PW2000"
Case optCategory(7).Value = True
Adodc1.Recordset.Fields("TOPICS"
= "PW4000"
End Select
Next X
I've also tried various other ways, but everytime the only ones that insert correctly are the first and last values (SOFTWARE and PW4000). ANy other selection inserts as 'SOFTWARE' Any help on this would be GREATLY appreciated. Thanks in advance.
Dim X
For X = 0 To Me.optCategory.Count - 1
Select Case optCategory(X).Value
Case optCategory(0).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(1).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(2).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(3).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(4).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(5).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(6).Value = True
Adodc1.Recordset.Fields("TOPICS"
Case optCategory(7).Value = True
Adodc1.Recordset.Fields("TOPICS"
End Select
Next X
I've also tried various other ways, but everytime the only ones that insert correctly are the first and last values (SOFTWARE and PW4000). ANy other selection inserts as 'SOFTWARE' Any help on this would be GREATLY appreciated. Thanks in advance.