Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a value of radio button in the option group Access VBA

Tags:

vba

ms-access

I've an Access 2010 form that contains 2 radio buttons. One for Yes and one for No in Option Group. How do I get the selected value?

i.e. - whether user selected Yes or No, using VBA.

like image 865
vuyy1182 Avatar asked Apr 24 '14 17:04

vuyy1182


1 Answers

Option Groups return an integer value starting at 1 and going up from there. If your option group is called Fld_Opt_Method then try Me.Fld_Opt_Method:

If Me.Fld_Opt_Method = 1 Then msgbox "first option"
If Me.Fld_Opt_Method = 2 Then msgbox "second option"

like image 186
PowerUser Avatar answered Sep 28 '22 03:09

PowerUser