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!

Option Groups and Reports

Status
Not open for further replies.

Mattine

Programmer
Apr 11, 2001
25
US
How do I validate an option group on a form through a command button? (Print, button for example) Do I have to have multiple reports or multiple queries?
 
I don't understand your question. Could you expand? Examples, table/query/form/report/field/control names are all helpful!

Joe Miller
joe.miller@flotech.net
 
Dear Joe,

I would like to be able to click a Command Button, labeled Print, that resolves on an option group. Within my option group, I have radio buttons such as; Date, Customer, Status, and Employee. When I click on the Employee Radio Button and then click on print, I would like it to call the employee report I have created and preview/print that report.

Does this help?

Thank-you for your help!
 
Yes it does. Each option in your Option group has a value which is a number. You can use a select case statement to select the appropriate report. Use the command button wizard and just make the print button go to any report in your database. Now go into the code window and you'll see a line that says:

stDocName = "ReportNameThatYouPicked"

Delete that line and replace it with your Select Case statement like this:

[tt]
Select Case MyOptionGroupName
Case 1
stDocName = "DateReportName"
Case 2
stDocName = "CustomerReportName"
Case 3
stDocName = "StatusReportName"
Case 4
stDocName = "EmployeeReportName"
End Select
[/tt]

Items in blue are the ones you need to change to match your situation. The 1,2,3,4 is a matchup of the value in your option group so check what number goes with which radio button.

HTH
Joe Miller
joe.miller@flotech.net
 
Dear Joe,

Thank-you for the help, I will try this out!

Sincerely,

~Mattine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top