I have an access form that I am using to generate a Word document.
On the form, I have a pseudo option group (because I want the user to be able to select more than one radio button)
The radio buttons are named opt1, opt2, opt3 etc., and the Access form is named frmMain.
In my code, I want to loop through the option buttons and and a row to the table on the Word doc if the option button is selected.
My code is as follows
dim strOpt as string
For i = 1 to 10
strOpt = "frmMain.opt" & i
If strOpt.value = -1 then
With .rows.add
.cell(1).range.text = "H"
.cell(2).range.text = "Special Radiused Insert"
end with
end if
next i
The problem is with the strOpt.value line. The syntax is not correct.
Thanks for your help in advance.
BusMgr
On the form, I have a pseudo option group (because I want the user to be able to select more than one radio button)
The radio buttons are named opt1, opt2, opt3 etc., and the Access form is named frmMain.
In my code, I want to loop through the option buttons and and a row to the table on the Word doc if the option button is selected.
My code is as follows
dim strOpt as string
For i = 1 to 10
strOpt = "frmMain.opt" & i
If strOpt.value = -1 then
With .rows.add
.cell(1).range.text = "H"
.cell(2).range.text = "Special Radiused Insert"
end with
end if
next i
The problem is with the strOpt.value line. The syntax is not correct.
Thanks for your help in advance.
BusMgr