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

need multiple reports or queries?

Status
Not open for further replies.

dumdum2

Programmer
Mar 18, 2000
98
GB
I would like to have a basic report and a form for a user to make selections for the report criteria, ie include people from a particular state or country, or people with a certain discipline etc. I've created combo boxes on the form for the user to make their selections. I'd like to use one report (and query?) if possible to display the user's selections but I'm having a hard time creating the right expressions in the query.

Is there an way to do this, or do I need to create multiple reports and queries?

Thanks!
 
Just one parametized query the report is based on.
eg in the criteria cell of state field:
=[Forms]![name of open mainform]![name of combo] OR [Forms]![name of open mainform]![name of combo] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks, but that doesn't seem to work...the query adds another column for the [Forms]![name of open mainform]![name of combo] and puts is null and is null in the criteria line.....i'm stuck...
 
I have a popup form with Two date boxes (for start and end dates), an option group to see the report in preview or send to printer, and an option group for type of report. The user puts in the dates and then selects the report type and whether to see it in preview or print it. Then clicks a button.
In the following code, Me![OutputTo] is the option group for preview or printer. Preview = 2, printer = 0 on their property sheet. The WClause decides what will be filtered for the report.

Private Sub Command9_Click()
Dim WClause, RName

Select Case [RptFrame]

Case 1
WClause = "[DateOfLease] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_And_Leasing_Rpt"

Case 2
WClause = "[FinalSettlementDate]is null"
RName = "Sales_And_Leasing_Rpt"

Case 3
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report"
Case 4
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report_Monthly"
Case 5
WClause = "[ReviewedDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Reag_Review_Date_Count_Rpt"
End Select

DoCmd.OpenReport _
ReportName:=RName, _
WhereCondition:=WClause, _
view:=Me![OutputTo]

End Sub
 
can i put two subform into one main form? i had try this,but once i redesign it again,it will display the two same subform in the main form..so did i need to create any micro or module?thx
 
DumDum2 Wrote:
thanks, but that doesn't seem to work...the query adds another column for the [Forms]![name of open mainform]![name of combo] and puts is null and is null in the criteria line.....i'm stuck...
======

How did you end up getting this to work? Mine still adds the other column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top