If Statement on Report?

J

JD McLeod

I want to create a report based on two tables. The first table is called
"AuditSubSection" and includes the fields AUDITSUBSECTION, AUDITSECTION,
INLCUDE IN REPORT, & FINDINGS. The first three fields are text and the last
two are Yes/No fields.

The second table is called "Findings" and includes the fields FINDING &
RECOMMENDATION.

Audit subsections may have one, more than one or no findings. In my report,
I want to show the steps performed and the findings, if any. If there were
no findings, I want the word "None" to print. The use would have only
entered findings if they existed, so they would not have gone into each
section and typed in the word None if there weren't any findings. Can I
create a report that looks at the "AuditSubSection" table and if the INCLUED
IN REPORT = -1 and FINDINGS = 0, then it prints "None", otherwise it just
prints the findings listed?

My problem could be in database design and not the report, but everything
else in this project has worked up until this piont, so if there is a way to
resolve this issue without reworking the entire project, that would be great.
Any advice would be much appreciated. Thanks in advance.
 
S

strive4peace

Hi JD

make a subreport based on AuditSubSection and set the LinkMasterFields
and LinkChildFields on the main report

on the Format event of the main report section that the subreport is in:

'~~~~~~~~~~~~~~~~~~~~~~
dim mBoo as boolean
If Me.subreport_controlname.Report.HasData Then
mBoo = true
else
mBoo = false
end if
subreport_controlname.visible = mBoo
label_None.visible = not mBoo
'~~~~~~~~~~~~~~~~~~

WHERE
subreport_controlname is the Name property of the subreport control
label_None is the Name property of a label that has caption --> "None"
and is positioned on top of the subreport control


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top