• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 918
  • Last Modified:

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

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
andrewpiconnect
Asked:
andrewpiconnect
  • 5
  • 2
1 Solution
 
andrewpiconnectAuthor Commented:
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
 
andrewpiconnectAuthor Commented:
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
 
Richard DanekeCommented:
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
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
andrewpiconnectAuthor Commented:
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
 
andrewpiconnectAuthor Commented:
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
 
Richard DanekeCommented:
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
 
andrewpiconnectAuthor Commented:
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

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.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now