Full Version: Error Message In Print Preview
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
gregdv
I have a database that consists of several forms accessed from an unbound Menu titled "SaMain". Each of these forms has command buttons based on macros to print a specific report from the form. One particular form has three command buttons to print three different reports of the form (Print Preview), ie front page, back page, and related additional information.

However, recently, after doing some simple code to change print margins in two of the reports (on Activate), I am now getting an code error window that says "This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables. (Error 3071)"

This happens even though I have removed the print margin code from the reports.

The interesting thing is that this error box refers to the unbound "SaMain" menu form when it comes up and OK has to be clicked three times before the report starts printing even when the "SaMain" form is closed Again this is in the Print Preview mode. Then, even when I deleted the "SaMain" form, the error box still comes up, but now refers to "Microsoft Access" in the title box. When I changed the print macros from Print Preview to Print, the error box does not appear.

What I have tried: New command buttons; new report, pasting old report info into new one; new database, importing tables, forms, ect from the old into the new. Nothing made a difference and I cannot locate the location of the error code.
fredrisg
Usually when I get an error message like that . . . it has something to do with the qry in the rpt.

Can you run the qry outside the report to see if generates the error?

Steve
gregdv
The report does not have a qry behind it. It does have 3 subreports with qrys, but they all work fine. I have two Union queries separate from this form and report that combine several tables, but they also open without problems.

Everything was working OK until, I believe, I changed the print margins using a simple code for these two reports. Interesting that the code worked in a 2000 version, but not in the 2002-03 version. Reason I did this is that going through all the motions to fix the bug that does not allow lower print margins, did not work. I am wondering if somehow the code (if this is the problem) got hidden someplace and effected these two reports. Again, it does not do it on a straight print, only when I go into Print Preview and then click on the print icon or from the File menu.

Thanks
Greg
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.