Solved

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

Posted on 2013-11-22
7
880 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
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.

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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