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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating report from multiple options

Status
Not open for further replies.

azalealee

Programmer
Nov 21, 2002
36
AU
I need help. I hope I can explain my problems adequately.

I'm developing reports for a hazard database. I have a form with 2 option groups and the following options:
Filter_Op_Group Sort_Op_Group
- Completed Tasks - Manager Responsible
- Uncompleted Tasks - Task Category
- Tasks Between Dates

When the user clicks the "Preview Report" button after selecting from both Option Groups, I would like a single generic report to open from the query containing info filtered from Filter_op_Group and then sorted by Sort_Op_Group.

Would appreciate any tips. Thanks in advance.

Azalea

Firstly, I'm having troubles writing the SQL code behind the query. Obviously, the query must be able to check the selected options and filter the right info from a single Hazard table. Do I generate 6 SQL statements for each set of options that look like this:

SELECT (table fields)
FROM T_HAZARD
WHERE Forms!ReportsMenu!Filter_Op_Group = 1
AND Forms!ReportsMenu!Sort_Op_Group = 1

If I do this, I don't know how to filter the right info from the table.

Secondly, because I only want a single report, how can the sorting category be defined in an unbound text-box contained in the header?
 
I think the easiest way is to create the report with the original source being the base table/query without any parameters. Then I would change the reports Source to a SELECT statement with the WHERE clause added. The WHERE clause would have the values of the Option Frames, not the actual form and object.

Does this make sense? God Bless,
Mike

Yes, I believe in Jesus. ;-)
"Neither is there salvation in any other: for there is none other name under heaven given among men, whereby we must be saved." (Acts 4:12, KJV)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top