Option Group and Related Controls

C

Carlos

I have a questionnaire with many option groups and their associated
toggle button option controls.
My question is how do I get the names of the controls as they are
related to the option group?

Psuedo Code Example:

For each OptionGroup
For each Toggle button in OptionGroup
Print Name and Value of Toggle Button
Get Name of Toggle Buttons
Next Toggle button
Next Option Group

Carlos
 
G

Guest

Can you explain what you are trying to achieve?

The reason I ask is that normally you would just check the value of each
Option Group not the controls within it...this value would tell which control
was selected and therefore all others were not.

Steve
 
C

Carlos

Never mind. I found an alternate solution:

Public Sub ChangeToggleButtonValue()
Dim frm As Form
Dim ctl As Control
Dim ctls As Controls

Set frm = Form_frmPTSD
Set ctls = frm.Controls

For Each ctl In ctls
If ctl.ControlType = acToggleButton Then
ctl.OptionValue = ctl.OptionValue + 1
End If
Next ctl

Set frm = Nothing
Set ctl = Nothing
Set ctls = Nothing

End Sub


The only problem with this solution is that I still do not know how to
relate the toggle buttons to their associated option group frame.

Carlos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top