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

Conditional (?) Sub Report

Status
Not open for further replies.

Freckles

Technical User
May 1, 2000
138
US
Program: Access 97
OS: NT 4.0

:cool: I am in the process of creating a report that has a sub-report only for selected main report pages. Example: Main report is sorted on custome and has page breaks after each customer with their open orders listed. For customes with certain conditions based on the customers location, I need to print a subreport, but not show anything on the reports for customers that do not meet the conditon.

Here is what I have tried -- both of which work great in the preview of the subreport only, but cause the main report to hanggggggggggggggg.

1. Basing the subreport on the same query that the main report is based on, but do a filter on the subquery.

2. Created a seperate query with the same fields as the main query selecting only the customers I want.

I know zilch regarding modules and VBA, but am pretty good on macros, and really good on queries, report formatting, etc. However, I can read and follow directions with the best of them.

HAVE A GREAT ST PATRICK'S DAY! And, watch out for the effects of the green beer.

Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
Hi Deb <Hic!>,
I'll assume you have a table of customers and a table of orders.
Your main report has all the customers and that is a query on its own.

Your sub report's query (altogether seperate), should have all the orders for only the customers in say &quot;Dublin&quot;.

Working through the main report in design view, if you click once on the sub report, then click on properties on the tool bar (hand holding beer menu), you will see its linked fields sub to main. Make sure these are good: probably something like &quot;CustomerID&quot; to &quot;CustomerID&quot;.
Within this same properties dialog make sure your sub report has can grow and can shrink both set to Yes. Go to the Menu bar and select Format-Size-To fit. Don't be spooked if it makes the sub report &quot;control&quot; resize quite a lot. Close and save and give it a try! Gord
ghubbell@total.net
 
Gord -- Email on the way -- please help ::) Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top