Solved

ms access 4 page report + subreport too big for detail section

Posted on 2013-11-22
7
872 Views
Last Modified: 2013-11-25
Hi,

I have created a report that spreads over 4 pages containing 1) covering letter, 2) certificate details 3) certificate summary 4) invoice. In order to get the report to work i had to create grouping as the report content was too high for the detail section. This works fine.

However, i now need to add a subreport to show details of any certificate endorsements on the certificate page (2). The subreport looks like a datasheet subform and works as intended. However, when i link the subreport to the main report by Cert_ID and run it i get an error message "the expression is typed incorrectly or is too complex to evaluate".
If i use "DoCmd.SendObject acSendReport, "Client Certificate", acFormatPDF" then access crashes.

Is it possible this is happening because for some reports there will be no records in the subreport?

Or am i better off starting the whole report from scratch?
0
Comment
Question by:andrewpiconnect
  • 5
  • 2
7 Comments
 

Author Comment

by:andrewpiconnect
ID: 39671187
As this report is pretty much like a for page contract is there a way to create a single report for each page but use some vba to execute and combine the four reports in the correct order and then attach it to the DoCmd.SendObject acSendReport, "Client Certificate", acFormatPDF"?
0
 

Author Comment

by:andrewpiconnect
ID: 39671301
okay here's what i have done so far:

The report is based on a query from 3 x tables. 1 tblClient 2 tblPolicy 3 tblInvoice

I have setup grouping (x 4) in the report based on tblPolicy.Policy_ID so i now have 4 x Policy_ID group headers.

This has allowed me to create 1 x page in each group header (cover letter, policy/cert, cert summary, invoice).

This all works fine.

If i put the subreport into the main report and do not link it by Policy_ID it runs fine but shows all records each time the report is run.

If i link the subreport to the main report by Policy_ID i get the dreaded error message "the expression is typed incorrectly or is too complex to evaluate"

FYI the subreport is based on a query from tblPolicy_Endt which is a linked table to tblPolicy by Policy_ID
0
 
LVL 18

Accepted Solution

by:
Richard Daneke earned 500 total points
ID: 39672532
Using a report that prints everything in a group header is too complicated for Access to determine which record to print.

The subreport query should be based on a unique report value in that group header.

Copy your intended subreport.   Change its underlying query to filter the records based on a report value (policy id) that is in the report header section where it will be printed.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:andrewpiconnect
ID: 39672898
Hi DoDahD,

Ok, ive done what you suggested and it works without crashing or giving an error. However, the subreport only seems to be pulling 1 record. I have even opened the subreport on its own and ran the query and that still only pulls 1 record (there are 3 records in the underlying table of the subreport and two of these have the same policy_id...here is the query.

SELECT tblPolicyPII_Endts.PolicyPII_ID, tblEndorsements.EndtTitle
FROM tblPolicyPII_Endts INNER JOIN tblEndorsements ON tblPolicyPII_Endts.Endt_ID = tblEndorsements.Endt_ID
WHERE (((tblPolicyPII_Endts.PolicyPII_ID)=[Reports]![LIME-PII-Policy-Client]![txtPolicyID]));

confused.com
0
 

Author Comment

by:andrewpiconnect
ID: 39673070
Oops my mistake with the subreport only showing 1 result..

Your solution works great!

Iro your first para....would you not recommend grouping the way i have implemented. If not then have you another suggestion?
0
 
LVL 18

Expert Comment

by:Richard Daneke
ID: 39674284
I am thankful that I could help.   There are usually several ways to create Access objects.   My philosophy is simple -- if it delivers to meet expectations, it works.

I see nothing objectionable in your approach to this report.  Mission accomplished!!!!
0
 

Author Comment

by:andrewpiconnect
ID: 39674304
Thanks for the feedback.....i try to use the same ethos wherever possible.....simplify as much as i can, whenever i can....
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now