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

Dummy data is printed in report 1

Status
Not open for further replies.

NVSbe

Programmer
Sep 9, 2002
153
0
0
BE
I have this code:

DoCmd.OpenReport "RPT PER AFDELING", acViewNormal


The report (RPT PER AFDELING) draws it's data from a table, which is filled right before the report is called.

Here's how it's done:
There's a table with records which have a class 1, 2, 3 and so on. The user selects a class, and the temp table is filled with the records of that class, with an extra sequence number.

The report (with graph) is opened, and draws it's data from that table, but only for sequence numbers between two values.

The problem is that sometimes (not all the times) when asked the print preview via that docmd command, the dummy data from the graph is printed, and NOT the correct data from the temporary table... Any ideas? I'm all out...

Thanks,
Niki
 
Hi nvsbe,

Instead of referring to a table for the report, refer it to a query and after the query just try the following command
mydb.Querydefs.refresh
before opening the report.

I assume that u are aware of creating querydefs.

Hope this will do.

Shyam,


 
Seemed to work... Can't tell for sure, because it seemed to be random. Thanks... :)
 
Further testing proved it not to work...

Right now the graph gets data usings

select blah blah from tbl_tmp where and so on..

Is that what you mean with a querydef? If not, I'm gonna need some more help here. I'm kinda new to working with Access and there's no documentation available here...
 
Hi,

You zip your proj and email it to me at cwizshyam@yahoo.com, and write clearly what problem u r facing, I will try to solve it, and send back the same to u, is that suits u?

shyam
 
No, sorry. Can't do that... I'm new here,and I don't think they'd like me sending out company projects... Not taking risks on that :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top