Option Group Code - Follow Up

  • Thread starter Thread starter TomP
  • Start date Start date
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,
 
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).
 
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".
 
Back
Top