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!

FILTER DATA

Status
Not open for further replies.

newbie2181

Technical User
May 27, 2003
77
GB
Hi,
I am using an access database that has a particular report in that needs to be printed, this is fine but its 300 odd pages long and only 20 or so of the pages are needed. So printing this results in a lot of wasted paper. The report is made up of data from 2 different tables containing different info. What i would ideally like to do is set up a query that strips all the data out of the first table thats of a particular type for example new business and then take the corresponding info out of the second table so that the report is formed but only 20 pages long. Is there any way of doing this and if so has anyone got anyone got any pointers for me cause i'm very new to all this!! lol

thanks a lot

Dan
 
Yes - there are a lot of ways of doing it.

The 'simplest' that comes to mind is adding a filter in the DoCmd.OpenReport line

If you open the report from a button on a form ( or similar ) in the code there will be a line that says

DoCmd.OpenReport "rptReportName", .. .. etc

In the properties of this action you'll find a place to add a WHERE Clause

What you put in the WHERE Clause will depend on what data you have in table 1 that you intend to use to make the decision about whether to include or exclude the record from the report

Eg.
If table1 contains a DateLoaded field then maybe the WHERE caluse could be

DateLoaded < #&quot; Format(Date() -30, &quot;Medium Date&quot;) & &quot;# &quot;



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Right so could i use

Transaction_type = &quot;NBS&quot;

Do i not need to create any relationships between the two tables?

Thanks

Dan
 
Where, Why ?

Surely the 'relationship' already exists - if the Report ( all 200 pages of it ) works at the moment then the relationship exists.
( Unless I've missed something in your explanation )


Try it and see.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Yeah i tried that and it didn't pull any data through at all?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top