S
sck10
Hello,
I am inserting the values for radio buttons on a form into a database.
There are 25 questions with 4 possible answers (see below). Is it possible
to pragmatically build the radio button name so I can loop through the
possibilities?
For example I would like to be able to build the rbn [01 - 25] in a loop
for:
If Me.rbn01q01.Checked = True Then strRad01 = "Poor"
If Me.rbn01q02.Checked = True Then strRad01 = "Satisfactory"
If Me.rbn01q03.Checked = True Then strRad01 = "Good"
If Me.rbn01q04.Checked = True Then strRad01 = "Excellent"
If Len(strRad01) <> 0 Then Call DBInsertUpdate("sp_web_Survey",
strDateStamp, Me.lblQ01.Text, strRad01)
....
If Me.rbn25q01.Checked = True Then strRad25 = "Poor"
If Me.rbn25q02.Checked = True Then strRad25 = "Satisfactory"
If Me.rbn25q03.Checked = True Then strRad25 = "Good"
If Me.rbn25q04.Checked = True Then strRad25 = "Excellent"
If Len(strRad25) <> 0 Then Call DBInsertUpdate("sp_web_Survey",
strDateStamp, Me.lblQ01.Text, strRad25)
I am inserting the values for radio buttons on a form into a database.
There are 25 questions with 4 possible answers (see below). Is it possible
to pragmatically build the radio button name so I can loop through the
possibilities?
For example I would like to be able to build the rbn [01 - 25] in a loop
for:
If Me.rbn01q01.Checked = True Then strRad01 = "Poor"
If Me.rbn01q02.Checked = True Then strRad01 = "Satisfactory"
If Me.rbn01q03.Checked = True Then strRad01 = "Good"
If Me.rbn01q04.Checked = True Then strRad01 = "Excellent"
If Len(strRad01) <> 0 Then Call DBInsertUpdate("sp_web_Survey",
strDateStamp, Me.lblQ01.Text, strRad01)
....
If Me.rbn25q01.Checked = True Then strRad25 = "Poor"
If Me.rbn25q02.Checked = True Then strRad25 = "Satisfactory"
If Me.rbn25q03.Checked = True Then strRad25 = "Good"
If Me.rbn25q04.Checked = True Then strRad25 = "Excellent"
If Len(strRad25) <> 0 Then Call DBInsertUpdate("sp_web_Survey",
strDateStamp, Me.lblQ01.Text, strRad25)