Report displays only first page

TallMan

Registered User.
Local time
Today, 05:16
Joined
Dec 5, 2008
Messages
239
Hello,

I have a querydef which a report is based off of. The query is created, the report is opened based off the query and then the query is deleted. I am having an issue when the report is long enough to reach two pages it only displays the first page of the report. I have the report to display in acViewReport. I dont understand why it is restricting the report to one page. When I changed the report dispy to preview it shows all of the pages. :confused:

Has anyone come accross this in the past? Any workarounds?


PHP:
Dim strsql As String
Dim qdf As DAO.QueryDef
DBEngine(0)(0).QueryTimeout = 0
strsql = "SELECT * from Tbl1";
 
Set qdf = CurrentDb.CreateQueryDef("test", strsql)
 
DoCmd.OpenReport "rptTest", acViewReport
 
>>The query is created, the report is opened based off the query and then the query is deleted.

How about killing the query def in the OnClose event of the report.
 
Same result...:confused:

Is this not a practical way of creating a report? I dont see why this should be happening....

Thank you for your help.

Tallman
 
I typically use the acViewPreview
The problem, as you've stated does not surface in that scenario.

How about.... When you click the button to open the report, ...check if the query def exists... If it does, delete and recreate. This way you know that the query is available at least untill the user runs the report again. (maybe incorporate the username into the name of the query def). I know this seems a round about way to get you there but... I can't think of anything else other than creating a temp table that gets purged and repopulated each time you run the report. (this also would need the additional column for the username ).

hth,
..bob
 
Hello,

When I click on the report without running the onClick command of my button the report does not generate because the query is not there. I am a little confused. Are you saying to check the "record source" of the report to see if there is anything there?

This is really frustrating..I have tried a bunch of work-arounds and cannot get anything to work.

The query generates over 200 records but it is only showing the first page. I would really like to figure this out, especially for future query/reports.
 
The difference between print preview and view is that the view method is purely to test layouts and gives the user a snapshot of the report, whereby the print preview generates the whole report.
 
DCrake,

I just learned something. Thanks for the info. I have to say I think it is sort of a waste though. I formatted the report with a print button so that all the associate has to do is click print and they are done, seems a little more professional then preview mode. I dont like the fact how the associate has to go to the ribbon for printing....doesnt seem to make much sense.

Well atleast I wont waste anymore time trying to figure out why this is happening.

Thank you both for your help!:)
 

Users who are viewing this thread

Back
Top Bottom