Accessing ind. option properties inside an Option Group

  • Thread starter Thread starter KRose
  • Start date Start date
K

KRose

Hello,

Is it possible to access an option button's properties which is inside
an option group?

I read one solution posted in 2004 which recommended a select...case
statement based on the option group's value. Is this still the
recommended solution? This can be a long select statement if you have
a lot of options within the option group.

My end goal is to access the option button which was selected's tag
property.

Thanks in advance!

Kevin

--
 
Definately, you want to compare the OptionValue of the button to the Value
of the group. You can then rearrange or revalue your buttons without
breaking the code.

This example is for an option group that interfaces a bunch of reports:

Dim strDoc As String
Select Case Me.grpReport.Value
Case Me.optClient.OptionValue
strDoc = "rptClient"
Case Me.optInvoice.OptionValue
strDoc = "rptInvoice"
'etc for other buttons
Case Else
MsgBox "Report " & Me.grpReport.Value & " not handled."
End Select
If strDoc <> vbNullString Then
DoCmd.OpenReport strDoc, acViewPreview
End If
 
Back
Top