I have a recordset i'm referencing for questions and responses; some of the questions are radio buttons that I want to put within their own group box at runtime. This way I will be able to create multiple questions with radio button answers.
If I don't associate the radio buttons with a group box, answering any radio button question makes that question's response true, all other questions become unsanswered.
Below is the code that i'm using; it's adding the controls and just performs a bringtofront on the radio buttons so they fall within the group box...but it doesn't associate the control to the group box.
If dr.Item("qType") = "rbtn" And i = 0 Then
Dim gbox = New GroupBox
gbox.Location = New Point(25, offset)
gbox.Text = dr.Item("qID")
gbox.Size = New Size(300, 90)
offset = offset + 20
If dr.Item("qType") = "rbtn" Then
i = i + 1
Dim rbtn = New RadioButton()
rbtn.Location = New Point(30, offset)
rbtn.Text = dr.Item("r")
rbtn.Checked = True
rbtn.Size = New Size(100, 20)
If i = 3 Then offset = offset + 40
If i <> 3 Then offset = offset + 20