We help IT Professionals succeed at work.
Get Started

How cycle through reports and print them

SteveL13
SteveL13 asked
on
58 Views
Last Modified: 2016-02-11
I have a report that has a query as it's record source.  The SQL of the query looks like:

SELECT tblClientSignAudit.ClientName, tblClientSignAudit.ClientAddress, tblClientSignAuditDetail.Location, tblClientSignAuditDetail.SiteImageFolder, tblTypeLU.Code, [SizeWidth] & "x" & [SizeHeight] & "x" & [SizeDepth] AS [Size], tblCompositeLU.Description AS Composition, tblConditionLU.Description AS Condition, tblClientSignAuditDetail.Electric, tblClientSignAuditDetail.Message, tblClientSignAuditDetail.Qty, tblClientSignAuditDetail.ClientAuditID, tblClientSignAuditDetail.TagNumber, tblTypeLU.Description, tblAuditTypesLU.Description, tblClientSignAudit.LogoFile
FROM (tblClientSignAudit LEFT JOIN tblAuditTypesLU ON tblClientSignAudit.SheetDescription = tblAuditTypesLU.ID) INNER JOIN (((tblClientSignAuditDetail LEFT JOIN tblTypeLU ON tblClientSignAuditDetail.Type = tblTypeLU.ID) LEFT JOIN tblCompositeLU ON tblClientSignAuditDetail.Composite = tblCompositeLU.ID) LEFT JOIN tblConditionLU ON tblClientSignAuditDetail.Condition = tblConditionLU.ID) ON tblClientSignAudit.ID = tblClientSignAuditDetail.ClientAuditID
WHERE (((tblTypeLU.Code)=[Forms]![frmSearchForClientAuditForReport]![txtCode]) AND ((tblClientSignAuditDetail.ClientAuditID)=[Forms]![frmSearchForClientAuditForReport]![cboSearch]))
ORDER BY tblTypeLU.Code;

Open in new window


This is working fine.  But now I want the user to be able to print all of the reports, one after another, without selected the "txtCode" from a combo-box.  Just cycle through them and print them.  In some cases there may not be records with a particular code.  In that case, just skip over that type and go on to the next.

How can I do this with VBA code?
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE