Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Buttons Used to Open Reports- Option Group 1

Status
Not open for further replies.

gabriellec

Programmer
Mar 20, 2001
19
US
I do not understand the total concept of getting VBA to look at what radio button (in an option group) the user clicked to get certain reports to open.

I understand that in an option group allows the user to select only one of the buttons. I also understand that Access puts a numeric value to each button (i.e. 1,2,3...). But I am not quite sure how to write the Select Case statement to open specific report when they pick that button.

Access 97

Thnx
 
You use the "option value" property of the buttons to determine which one a user clicked. For example, if you have an option group called "Type" and 5 buttons, you can set the option value of the 1st button to 1, 2nd button to 2, etc...

Then you write a case statement to evaluate the buttons like so:

Select Case Me![Type]
Case 1
<do stuff>
Case 2
<do stuff>
Case 3
<do stuff>
Case 4
<do stuff>
Case 5
<do stuff>
Case else
msgbox &quot;Did you press a button??&quot;
End Select
 
Do I put the Select Case statement into the Click event for the option group?
 
Depends on what you want to do. If you want to open up reports or other forms, then create a command button called &quot;process&quot; or something like that and put this code in the click event of the command button.
 
On an option button group you would make the select case afterupdate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top