?
Solved

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

Posted on 2013-11-22
7
Medium Priority
?
888 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 19

Accepted Solution

by:
Richard Daneke earned 2000 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

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 19

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

800 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