Solved

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

Posted on 2013-11-22
7
875 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

809 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