Option Groups select

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
 
R

Reggie

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
 
G

Guest

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
 
S

Stefanos_Karametos

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.
 

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