Initially Print Preview missing data ? (1 Viewer)

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
Hello,

I have a button which opens a report in print preview mode.

When it is clicked, some of the text boxes are empty.

If I then open the report in report view, or layout view, the data appears.

Anyone know how to make it appear first time in print preview mode?
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
Is very strange. If i set the report to open in report view, it also doesnt show all the data.

Is as if the report is made before the data is available, and then the data is available later and then whatever you change it to, you can see all the information.
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
Is there a way to delay the creation of a form so that I can test if this is a data queue issue?
 

isladogs

MVP / VIP
Local time
Today, 04:05
Joined
Jan 14, 2017
Messages
18,218
I have seen the same effect before.
From memory, it can happen if variable values aren't transferred from form to report

If you are using VBA rather than a macro, try stepping through the code.
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
I am using variables that are being calculated from other values on the report.

I am using VBA.

Im really stuck. I have a database with lots of reports, all work fine, except this one.

Very strange. I just dont understand that no matter how I initially display the report, it doesnt work, and if i change to any other view, then it does. This is a problem as I can only print it by changing view.
 

isladogs

MVP / VIP
Local time
Today, 04:05
Joined
Jan 14, 2017
Messages
18,218
Have you tried creating a new copy of the report - it may be corrupted??
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
Yes, I tried that. No joy.

I have tried removing everything from the report, just an ID. Its still not working.

I noticed that in the filter field of the report it just has "0". Not sure where this is coming from. This is definitely blocking the load of the report.

In the where condition of the DoCmd for the report I have referenced a particular ID which for some reason is not reaching the report and being replaced with "0".
 

isladogs

MVP / VIP
Local time
Today, 04:05
Joined
Jan 14, 2017
Messages
18,218
Perhaps that record contains corrupted data
Try deleting that record if the data is not crucial
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
I have fixed it. Its a bit of a bodge, but I called added some vba to save the record several times and for some reason this works. Saving Once doesnt, but a minimum of twice seems to make it work.

Thanks.
 

ahmed_optom

Registered User.
Local time
Today, 04:05
Joined
Oct 27, 2016
Messages
93
Ok, I have implemented a further fix for this, which I am happier with.

It involves storing some information as variables. then re querying the form, this ensures that the previous record is saved and completed, then loading the report from the variable that we saved earlier.

Theres probably an easier way, but i have been dealing with this problem for over a week now, and I couldnt find it. Hope this helps someone.
 

JHB

Have been here a while
Local time
Today, 05:05
Joined
Jun 17, 2012
Messages
7,732
Could you post your database with some sample data + a description how to reproduce the fault?
 

Users who are viewing this thread

Top Bottom