Expression too complex when Printing Report (1 Viewer)

seguinsoftware

Registered User.
Local time
Today, 01:34
Joined
Sep 25, 2009
Messages
10
I have a weird problem... I have an Access application that print a report with 7 sub-reports in it. When I preview the report, it looks fine. When I print it directly to the printer, it looks fine. The problem is when I print from the preview, Access error with a "...too complex..." error and crashes the application.

Weird, huh?

Ideas?

Thanks in advance!
 

vbaInet

AWF VIP
Local time
Today, 06:34
Joined
Jan 22, 2010
Messages
26,374
This might be a long one!

What kind of calculations do you have one your main report and the subreports?
 

seguinsoftware

Registered User.
Local time
Today, 01:34
Joined
Sep 25, 2009
Messages
10
No calculations. It is strictly a contact sheet. The 7 reports are other areas of the contact (i.e. medications list, allergies list, etc.) that are linked to the main report via an ID field.
 

vbaInet

AWF VIP
Local time
Today, 06:34
Joined
Jan 22, 2010
Messages
26,374
Just to confirm, you don't have any calculations in the Record Source (i.e. query or table) of your report/subreports? Please double-check.
 

seguinsoftware

Registered User.
Local time
Today, 01:34
Joined
Sep 25, 2009
Messages
10
None, to filter the report on the current client I pass a "[ID]=?" in the WHERE clause of the docmd.openreport function where ? is the ID number of the current client.
 

vbaInet

AWF VIP
Local time
Today, 06:34
Joined
Jan 22, 2010
Messages
26,374
There has to be some calculation somewhere that's causing this error. Are any of the record sources a query of a query? Or a query of a query of a query? And are there any subqueries?

If a query is based on another query, have a look in the base query for any calculations.

Otherwise, upload your db with some test data and I'll take a look.

Side note: quite surprised that you've only ever posted twice since you joined in 2009 ;)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:34
Joined
Feb 28, 2001
Messages
27,321
Printing from the report preview doesn't impose top/bottom margins on a page. Taking a SWAG, I would say that the routine that is attempting to do print scaling is somehow barfing when it gets some number of lines down and it starts getting overflows. The manifestation of that barf is possibly the cause of the error you see.

1st suggested experiment: Copy the DB to another file and reduce the number of records in the copy's main table drastically to see if perhaps one main record and its associated sub-reports will print whereas the full size of the main table would not.

2nd suggested experiment: If your printer has legal size paper and your report could print reasonably in portrait orientation, temporarily set it to default to legal print and repeat experiment 1.

3rd suggested experiment: If your printer allows you to set its resolution (in dots per inch), change that to its max and later to its min value, then for each case repeat experiment 1.

The goal is to rule out that this is actually a printer scaling computation - and there is no guarantee that ANY of these experiments will work correctly. However, if changing printer parameters changes the result, your problem is almost certainly that you have too much data vertically on the page, i.e. too many print rows.

If you have more than one printer with different resolution than your primary printer, that might also work differently. If you have other software that lets you print your document to a file that is external to Access, that might also allow you to test this same concept.
 

seguinsoftware

Registered User.
Local time
Today, 01:34
Joined
Sep 25, 2009
Messages
10
I joined in 2009, I think I did post back then a couple times, but am not sure :)

My back-end is SQL Server and the underlying table has a couple thousand clients (not a lot DB speaking) and the associated child-tables may have another couple hundred thousand records (but each client would only have a few child-records).

The report is only printing 1 client at a time.

I have tried different printers, but I will try playing with the margins and scaling and see if that makes a difference.

The real odd thing is, if I print directly to the printer it is fine. Preview is fine. It is just printing from preview that causes the error.
 

vbaInet

AWF VIP
Local time
Today, 06:34
Joined
Jan 22, 2010
Messages
26,374
I see, I was only curious :)

And to add to the list of suggestions, here's another:
* Remove each subreport (starting from the bottom) one after the other to try and figure out which one is causing the problem.
 

Users who are viewing this thread

Top Bottom