Option Groups select

  • Thread starter Thread starter juan
  • Start date Start date
J

juan

Hi,
I have a form with an Option group with four otion buttons.
I want to create a button and add code so that it runs a
specific macro depending on the option selected.
Example,
If optionbutton 1 is select, then run this macro
else option button 2 is select, then run this macro
etc. I'm not too familiar with this, try to do something
like in excel but not the same.
Would appreciate any info.

Thanks,
Juan
 
Juan, Place something like this in the After Update event of your option
group

Private Sub optGroup1_AfterUpdate()
Select Case Me.optGroup1.Value
Case 1
DoCmd.RunMacro "Macro1"
Case 2
DoCmd.RunMacro "Macro2"
Case 3
'.....etc., etc.,
End Select
End Sub
 
Hello Reggie,
thanks for your help. I actually put this in the button
not on the after update of the group. Works good
Once again thanks for your help.

Juan
 
Reggie said:
Juan, Place something like this in the After Update event of your option
group

Private Sub optGroup1_AfterUpdate()
Select Case Me.optGroup1.Value
Case 1
DoCmd.RunMacro "Macro1"
Case 2
DoCmd.RunMacro "Macro2"
Case 3
'.....etc., etc.,
End Select
End Sub

--
Reggie

----------



Hi,
I have a form with an Option group with four option buttons.
I want to create a Next button ( outside the oprion box) and add code so
that it runs a
specific macro depending on the option selected inside the option box.
Example,
If optionbutton 1 is select and you press the Next button, then run this macro
else if option button 2 is select and you press the option button , then run
this macro
etc. I'm not too familiar with this...
Would appreciate any info.
 
Back
Top