Tawcan
03-26-2003, 10:12 AM
Hi,
Say I have a report that's 10 pages.... is it possible to display only a certain page (ie page 2 only) on the report view? If so how could I do this?
Thanx.
nightwalker
03-28-2003, 02:03 PM
There is a Pages Collection which has Page as the Object ... and then you can specify the number of the page you actually wanna see ... its same concept as Forms Collection ...
Originally posted by Tawcan
Hi,
Say I have a report that's 10 pages.... is it possible to display only a certain page (ie page 2 only) on the report view? If so how could I do this?
Thanx.
Tawcan
03-28-2003, 02:40 PM
Where is "Pages Collecction" under? I can't seem to find the control anywhere. :o
Pat Hartman
04-01-2003, 01:38 PM
How would you know ahead of time which page(s) you wanted to display? If you want to limit the output to particular records, use either the filter or where arguement of the OpenReport Method. If you want to print specific page ranges or multiple copies, use the PrintOut Method.
Tawcan
04-01-2003, 03:43 PM
The report can range from 2 - 6 pages.
Ok I found a way to do this by using filter....but I'm not very good with VB coding...please help.
Right now the code is:
Me.FilterOn=True
Me.Filter = " conditions/criterias "
In the table that the report reads, there are fields such as YEAR, REQ COURSES, SESSION, GRADES, etc.
For my condition I want YEAR = 1, YEAR = 2, YEAR = 3, GRADE < 50 % or Grade = " F " and so on...
But when I do
Me.Filter= "YEAR=2"
Access complains about the code.... could someone help me on how I could set the conditions/criterias for the filter using VB code? Also how do I use AND, OR and stuff like that on coding?
How do you use OpenReport/PrintOut methods?
Me.PrintOut= "2" - > page 2 ?
:confused:
Thanx. :)
Pat Hartman
04-01-2003, 09:15 PM
I think you will have an easier time if you use the where argument of the OpenReport Method rather than using the filter within the report's code module.
You can formulate the where argument depending on what selection you need. BTW, if you really have a field named YEAR, chang it to something else. Year is the name of a function.
strWhere = "(myYEAR = 1 OR myYEAR = 2 OR myYEAR = 3) AND (GRADE < '50' or Grade = 'F')"
Tawcan
04-02-2003, 10:25 AM
Hmmm so if I use OpenReport I can limit to which page I want to view? (not print, view).
Tried using filter again but doesn't seem to work..
I did:
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Forms![INDIVIDUAL APR]!Box2
Me.Filter = GRADES < "50"
Me.FilterOn = True
End Sub
When I tried running the program Access complained that the Me.Filter line contains no value. :confused:
Also tried
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Forms![INDIVIDUAL APR]!Box2
Me.Filter = ([Forums![INDIVIDUAL APR]!Box2].GRADES < "50")
Me.FilterOn = True
End Sub
This time it tells me that [ cannot be found... take out the [ ] and it says missing object. :confused: :confused: :confused:
Tawcan
04-02-2003, 11:34 AM
Nm I got it. :p
It's Me.Filter="GRADES < '50' "
:D
Tawcan
04-03-2003, 10:28 AM
Hmmm filter seems to work with my reports...
But when I use the subreport properties to show these reports on a main report page, Access complains about the filter conditions.... " The setting you entered isn't valid for this property"
Any idea why? :confused:
Pat Hartman
04-04-2003, 07:09 PM
You can't filter subreports or subforms.