Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8

    Question Troublesome Reporting Glitches

    I am having some trouble figuring out why my report (with multiple sub reports) is repeating whenever I exceed mor that one item entered into the associated form. Specifically, I am using an internal use only form to input five key components to a contract; Work Description, Misc Job Expenses, Job Fees, Job Material and Job Time. I can enter multiple lines into the Work Descriptions, and all is fine (See attach Screen_01), my report prints a single summary of the descriptions. Same is true as long as I only enter one line into any of the remaining four categories. The trouble comes when I enter more than one line in any of those four categories (see attach Screen_02), the report glitches and repeats all of the sub reports for as many lines I may add...ex: add two repeats everything twice, three, thrice, so on and son on! (See attach Screen_03).



    Not sure what could be doing this and seeking your help in investigation this. If you need more information or screenshots, please ask and I will post accordingly. Any help in focusing my efforts would be greatly appreciated.




    Click image for larger version. 

Name:	Screen_01.png 
Views:	16 
Size:	29.7 KB 
ID:	48461Click image for larger version. 

Name:	Screen_02.png 
Views:	16 
Size:	56.1 KB 
ID:	48462Click image for larger version. 

Name:	Screen_03.png 
Views:	16 
Size:	25.4 KB 
ID:	48463

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    fstetson,

    Is this something new? Did the report or part of it work previously?
    Did this logic and reporting work in your development/testing?
    Sounds like sorting/grouping issue, but readers will need to see more of your design to offer focused advice.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Open the report's record source and see if you get duplicates when the report itself shows them; if yes than that is your cause. Usually with your setup you use a one table record source for the main report (lets say tblJobs) and link the subreports via the PK (JobID)\FKs (in tblJobDescription, tblJobExpenses...).
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    Is this something new? No

    Did the report or part of it work previously? No, this has been an ongoing issue. I am just now narrowed it to impacts I listed in original post

    Did this logic and reporting work in your development/testing? I did not test for it

    Sounds like sorting/grouping issue, but readers will need to see more of your design to offer focused advice. What would be the best to see? I do not want to bombard with too much.

  5. #5
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    All of the sub reports, and their relative queries display as desired.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,925
    Cartesian join?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Not the subreports but the main report. Can you show us the report in design view and its record source? How do you link the report\subreport(s)?
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    @Vlad

    They are linked by JobID
    Click image for larger version. 

Name:	Screen_04.png 
Views:	15 
Size:	43.9 KB 
ID:	48464

  9. #9
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    Here is the relationship table, all the sub queries are using option two of Join Properties
    Click image for larger version. 

Name:	Screen_05.png 
Views:	16 
Size:	49.5 KB 
ID:	48465

  10. #10
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    Here is the report SQL Statement, hope these answers all!


    SELECT IIf(IsNull([CustomerFirstName2]),[Tbl_WorkOrders]![JobCustomer],[Tbl_WorkOrders]![JobCustomer] & " & " & [CustomerFirstName2] & " " & [CustomerLastName2]) AS JobCustomer, tbl_Workorders.JobID, [Tbl_Customers]![Customer] AS Customer, IIf(IsNull([JobCustomer]),[BillingContactCompanyName],[BillingContactFirstName] & " " & [BillingContactLastName]) AS BillingContactOld, Len([BillingContact]) AS BCLength, Trim(IIf(IsNull([BillingContactCompanyName]),[BillingContactFirstName] & " " & [BillingContactLastName],[BillingContactCompanyName])) AS BillingContact, tbl_Workorders.JobContact, [CustomerFirstName2] & " " & [CustomerLastName2] AS 2ndContact, tbl_Customers.CustomerFirstName2, tbl_Customers.CustomerLastName2, IIf(IsNull([customer]),"",[customer] & " " & [customerlastname]) AS Cust, tbl_Customers.EmailOne, tbl_Customers.EmailTwo, tbl_Customers.BillingHouseNumber, tbl_Customers.BillingStreet, tbl_Customers.BillingAddress, tbl_Customers.BillingCity, tbl_Customers.BillingState, tbl_Customers.BillingZip, tbl_Customers.BillingPhone1Type, tbl_Customers.BillingPhone1, tbl_Customers.BillingExt1, tbl_Customers.BillingPhone2Type, tbl_Customers.BillingPhone2, tbl_Customers.BillingExt2, tbl_Customers.BillingPhone3Type, tbl_Customers.BillingPhone3, tbl_Customers.BillingExt3, tbl_Customers.BillingPhone4Type, tbl_Customers.BillingExt4, tbl_Customers.BillingFax, "Thank you, " & [estimator] AS Thanks, tbl_Customers.CustomerLastName, tbl_Workorders.JobHouseNumber, tbl_Workorders.JobStreet, tbl_Workorders.JobSt, tbl_Workorders.JobAddress, tbl_Workorders.JobCity, tbl_Workorders.JobZip, tbl_Workorders.JobPhone1Type, tbl_Workorders.JobPhone2Type, tbl_Workorders.JobPhone3Type, tbl_Workorders.JobPhone4Type, tbl_Workorders.JobContactPhone4, tbl_Workorders.JobContactPhone1, tbl_Workorders.JobContactPhone2, tbl_Workorders.JobContactPhone3, tbl_Workorders.JobStart, tbl_Workorders.CreateDate, tbl_Workorders.Estimator, tbl_Workorders.JobSiteEmployee, tbl_Workorders.JobReference, tbl_Workorders.Notes, Q_113_d_SumPreInvoiceJobMisc.JobMiscCost, Q_113_a_SumPreInvoiceJobTime.JobTimeRate, Q_113_b_SumPreInvoiceJobFees.JobFeePrice, Q_113_c_SumPreInvoiceJobMaterial.JobMaterialTotal, Q_113_e_SumPreInvoiceJobContract.JobContractAmount , tbl_Workorders.JobPaymentDown, tbl_Workorders.JobPaymentDownNote, tbl_Workorders.JobPaymentDownNoteExt, tbl_Workorders.JobPayment1, tbl_Workorders.JobPayment1Note, tbl_Workorders.JobPayment1NoteExt, tbl_Workorders.JobPayment2, tbl_Workorders.JobPayment2Note, tbl_Workorders.JobPayment2NoteExt, tbl_Workorders.JobPaymentFinal, tbl_Workorders.JobPaymentFinalNote, tbl_Workorders.JobPaymentFinalNoteExt
    FROM tbl_Customers INNER JOIN (((((tbl_Workorders LEFT JOIN Q_113_a_SumPreInvoiceJobTime ON tbl_Workorders.JobID = Q_113_a_SumPreInvoiceJobTime.JobID) LEFT JOIN Q_113_b_SumPreInvoiceJobFees ON tbl_Workorders.JobID = Q_113_b_SumPreInvoiceJobFees.JobID) LEFT JOIN Q_113_c_SumPreInvoiceJobMaterial ON tbl_Workorders.JobID = Q_113_c_SumPreInvoiceJobMaterial.JobID) LEFT JOIN Q_113_e_SumPreInvoiceJobContract ON tbl_Workorders.JobID = Q_113_e_SumPreInvoiceJobContract.JobID) LEFT JOIN Q_113_d_SumPreInvoiceJobMisc ON tbl_Workorders.JobID = Q_113_d_SumPreInvoiceJobMisc.JobID) ON tbl_Customers.CustomerID = tbl_Workorders.CustomerID
    WHERE (((tbl_Workorders.JobID)=[Forms]![Frm_Customer_WorkOrders]![JobID]));

    WHERE (((tbl_Workorders.JobID)=[Forms]![Frm_Customer_WorkOrders]![JobID]));

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Did this logic and reporting work in your development/testing? I did not test for it
    Do you have a test database that you can add a few sample records and post same for readers to review?
    All that is needed is a few test records----Porky Pig, CapitalCity, JobOne etc nothing personal/confidential. Readers will want to see the structures, recordsources and any ancillary logic/code.

  12. #12
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    So if you open Q_113_g_JobSheetMain do you get two records if you have two entries in one of the 4 troublesome components\tables? My initial point was that you do not need all this info in the record source for the main report, you only need the fields in the report header and footer. Remove all the left-joined queries and use them individually as record sources for their corresponding subreport.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Formatted sqlvia Poor SQL)
    Code:
    SELECT IIf(IsNull([CustomerFirstName2]), [Tbl_WorkOrders] ! [JobCustomer], [Tbl_WorkOrders] ! [JobCustomer] & " & " & [CustomerFirstName2] & " " & [CustomerLastName2]) AS JobCustomer
    	,tbl_Workorders.JobID
    	,[Tbl_Customers] ! [Customer] AS Customer
    	,IIf(IsNull([JobCustomer]), [BillingContactCompanyName], [BillingContactFirstName] & " " & [BillingContactLastName]) AS BillingContactOld
    	,Len([BillingContact]) AS BCLength
    	,Trim(IIf(IsNull([BillingContactCompanyName]), [BillingContactFirstName] & " " & [BillingContactLastName], [BillingContactCompanyName])) AS BillingContact
    	,tbl_Workorders.JobContact
    	,[CustomerFirstName2] & " " & [CustomerLastName2] AS 2 ndContact
    	,tbl_Customers.CustomerFirstName2
    	,tbl_Customers.CustomerLastName2
    	,IIf(IsNull([customer]), "", [customer] & " " & [customerlastname]) AS Cust
    	,tbl_Customers.EmailOne
    	,tbl_Customers.EmailTwo
    	,tbl_Customers.BillingHouseNumber
    	,tbl_Customers.BillingStreet
    	,tbl_Customers.BillingAddress
    	,tbl_Customers.BillingCity
    	,tbl_Customers.BillingState
    	,tbl_Customers.BillingZip
    	,tbl_Customers.BillingPhone1Type
    	,tbl_Customers.BillingPhone1
    	,tbl_Customers.BillingExt1
    	,tbl_Customers.BillingPhone2Type
    	,tbl_Customers.BillingPhone2
    	,tbl_Customers.BillingExt2
    	,tbl_Customers.BillingPhone3Type
    	,tbl_Customers.BillingPhone3
    	,tbl_Customers.BillingExt3
    	,tbl_Customers.BillingPhone4Type
    	,tbl_Customers.BillingExt4
    	,tbl_Customers.BillingFax
    	,"Thank you, " & [estimator] AS Thanks
    	,"6820 South Ave. Saint Paul, MN 55344" AS MHStreet
    	,"612-328-4789 -- 952-345-0124 -- 651-366-4785" AS MHPhone
    	,tbl_Customers.CustomerLastName
    	,tbl_Workorders.JobHouseNumber
    	,tbl_Workorders.JobStreet
    	,tbl_Workorders.JobSt
    	,tbl_Workorders.JobAddress
    	,tbl_Workorders.JobCity
    	,tbl_Workorders.JobZip
    	,tbl_Workorders.JobPhone1Type
    	,tbl_Workorders.JobPhone2Type
    	,tbl_Workorders.JobPhone3Type
    	,tbl_Workorders.JobPhone4Type
    	,tbl_Workorders.JobContactPhone4
    	,tbl_Workorders.JobContactPhone1
    	,tbl_Workorders.JobContactPhone2
    	,tbl_Workorders.JobContactPhone3
    	,tbl_Workorders.JobStart
    	,tbl_Workorders.CreateDate
    	,tbl_Workorders.Estimator
    	,tbl_Workorders.JobSiteEmployee
    	,tbl_Workorders.JobReference
    	,tbl_Workorders.Notes
    	,Q_113_d_SumPreInvoiceJobMisc.JobMiscCost
    	,Q_113_a_SumPreInvoiceJobTime.JobTimeRate
    	,Q_113_b_SumPreInvoiceJobFees.JobFeePrice
    	,Q_113_c_SumPreInvoiceJobMaterial.JobMaterialTotal
    	,Q_113_e_SumPreInvoiceJobContract.JobContractAmount
    	,tbl_Workorders.JobPaymentDown
    	,tbl_Workorders.JobPaymentDownNote
    	,tbl_Workorders.JobPaymentDownNoteExt
    	,tbl_Workorders.JobPayment1
    	,tbl_Workorders.JobPayment1Note
    	,tbl_Workorders.JobPayment1NoteExt
    	,tbl_Workorders.JobPayment2
    	,tbl_Workorders.JobPayment2Note
    	,tbl_Workorders.JobPayment2NoteExt
    	,tbl_Workorders.JobPaymentFinal
    	,tbl_Workorders.JobPaymentFinalNote
    	,tbl_Workorders.JobPaymentFinalNoteExt
    FROM tbl_Customers
    INNER JOIN (
    	(
    		(
    			(
    				(
    					tbl_Workorders LEFT JOIN Q_113_a_SumPreInvoiceJobTime ON tbl_Workorders.JobID = Q_113_a_SumPreInvoiceJobTime.JobID
    					) LEFT JOIN Q_113_b_SumPreInvoiceJobFees ON tbl_Workorders.JobID = Q_113_b_SumPreInvoiceJobFees.JobID
    				) LEFT JOIN Q_113_c_SumPreInvoiceJobMaterial ON tbl_Workorders.JobID = Q_113_c_SumPreInvoiceJobMaterial.JobID
    			) LEFT JOIN Q_113_e_SumPreInvoiceJobContract ON tbl_Workorders.JobID = Q_113_e_SumPreInvoiceJobContract.JobID
    		) LEFT JOIN Q_113_d_SumPreInvoiceJobMisc ON tbl_Workorders.JobID = Q_113_d_SumPreInvoiceJobMisc.JobID
    	) ON tbl_Customers.CustomerID = tbl_Workorders.CustomerID
    WHERE (((tbl_Workorders.JobID) = [Forms] ! [Frm_Customer_WorkOrders] ! [JobID]));

  14. #14
    Fstetson is offline Novice
    Windows 10 Office 365
    Join Date
    Nov 2020
    Location
    http://www.htmdb.net
    Posts
    8
    I have to correct myself, the query return for the SQL above does show three records, not one.

  15. #15
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    So there you have it, the report will repeat the details section three times... Please follow the suggestions in post #12 and "report" back the results.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Reporting
    By licka in forum Reports
    Replies: 2
    Last Post: 11-29-2020, 05:41 PM
  2. Reporting
    By licka in forum Reports
    Replies: 4
    Last Post: 11-19-2020, 07:00 PM
  3. Help with reporting
    By stevo7624 in forum Access
    Replies: 1
    Last Post: 09-03-2012, 09:54 PM
  4. reporting
    By jaykappy in forum Reports
    Replies: 10
    Last Post: 02-16-2012, 03:02 PM
  5. Visual Formatting Glitches on Report
    By trb5016 in forum Reports
    Replies: 0
    Last Post: 07-29-2010, 09:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums