Option Group Code - Follow Up

T

TomP

How do you set the controls on the option group to allow a user to have
control on what items will be executed from the list? I noticed that
whatever is on the top of the list, that record will always run first
regardless.

Thank you,
 
M

Michael J. Strickland

Sounds like you need to use checkboxes, not option buttons.

If you want to select only one of several options, you use option buttons.

If you want to select one or more of several options, you use checkboxes
(or a listbox/combobox).
 
G

George Nicholson

An option group only allows one selection. You add code to the FRAME
containing the group to determine what action is taken:

Private Sub FrameMyOptionGroup_AfterUpdate()
Select Case FrameMyOptionGroup.Value
'Note: 1 and 2 correspond to the OptionValue property assignments of
the group members
' Frame.Value = the OptionValue of the current selection.
Case 1
DoCmd.OpenReport "caseload report summary", acViewPreview
Case 2
DoCmd.OpenReport "caseload report detail", acViewPreview
Case Else
'Optional error message here. It shouldn't ever happen but nice
to know if it does..
End Select
End Sub

The Select case could be attached to the Click event of a "Preview" button
rather than the Frame_AfterUpdate event. In that case your Case Else should
probably prompt the user to "Please select a Report".
 

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