Accessing ind. option properties inside an Option Group

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

--
 
A

Allen Browne

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
 

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