M
Martin Williams
I have a working version of my survey program, but i'm trying to optimize
now. On the last page, i have a sub that examines all of the answers and
assigns them to variables for uploading to the dataset. A few questions
have multiple checkboxes and i used multiple 'if then' statements to append
the text of the checked boxes to a variable.
I decided to try and tighten the code, but it doesn't seem to work. Can
anyone tell me why?
dim ctrl as control
dim sbQ4 as new StringBuilder(QuestionFourAnswer) // This is a public
variable
for each ctrl in frmpage2.controls
if typeof ctrl is panel then
if ctrl.name is frmpage2.pnlQ4 then
for each subctrl as checkbox in frmpage2.pnlQ4.controls
if subctrl.checked = true then
sbQ4.append(subctrl.text + ", ")
end if
next
end if
end if
next
now. On the last page, i have a sub that examines all of the answers and
assigns them to variables for uploading to the dataset. A few questions
have multiple checkboxes and i used multiple 'if then' statements to append
the text of the checked boxes to a variable.
I decided to try and tighten the code, but it doesn't seem to work. Can
anyone tell me why?
dim ctrl as control
dim sbQ4 as new StringBuilder(QuestionFourAnswer) // This is a public
variable
for each ctrl in frmpage2.controls
if typeof ctrl is panel then
if ctrl.name is frmpage2.pnlQ4 then
for each subctrl as checkbox in frmpage2.pnlQ4.controls
if subctrl.checked = true then
sbQ4.append(subctrl.text + ", ")
end if
next
end if
end if
next
