Problem with Report

vito1010

Registered User.
Local time
Today, 16:02
Joined
Aug 14, 2014
Messages
34
I hope I explain this correctly.
I have a form (PCs) and a subForm (Notes).
I have a report (Prt21) with the subReport (Notes).
In the Form NOTES, I have a checkbox. Check to Suppress Printing that record.
In the NOTES Report subReport It prints a Note and the Entered Date.
In the controls for them I have:
=IIF([Flagger] is True, "REDACTED", [Notes] and =IIF([Flagger] is True, "", [EDATE])

When I run the report, if the Suppress Box is checked, it will not print the EDate or the corrospsonding Note.
If it's not checked, I get #Errors.

I'm including a PDF of a "report" for a dummy record.

Thanks
Vito
 

Attachments

I've never seen syntax "is True", just "= True". Simplify:

=IIf([Flagger], "REDACTED", [Notes])

=IIf([Flagger], "", [EDATE])

You are not suppressing printing a record, you are conditionally display field values for every record.

If you want to exclude flagged records, apply filter criteria.
 
Last edited:
Sorry, I did have as you said. I typed my post from memory.
The Checkbox in NOTES is labeled "SUPPRESS PRINT", but I realize it's conditionally display. Thanks. I'll retype in what you suggested. Maybe I typed it wrong.
I'll check
 
=IIF([Flagger] is True, "REDACTED", [Notes] and =IIF([Flagger] is True, "", [EDATE])
You might have to read up, IIF function, to know how you can apply it to meet your needs, the syntax you are using is wrong.
 
I corrected above. It's actually:
=IIf([Flagger], "REDACTED", [Notes])
=IIf([Flagger], "", [EDATE])

I also had
=IIf([Flagger] = True, "REDACTED", [Notes])
=IIf([Flagger] = True, "", [EDATE])

Both of these DO give me the same result, Error if not checked and "REDACTED" if checked (and date is "").


The Is True entered into it when I looked at an old DB I did years ago and I tried that. Sorry about the confusion.

So, if
=IIf([Flagger], "REDACTED", [Notes])
=IIf([Flagger], "", [EDATE])
is incorrect Syntax, what is the correct way?

Thank you

(I went back and removed the EDATE line, as it doesn't matter if a date is shown.)
 
I provided valid syntax so I am at a loss as to cause of error. If you want to provide db for analysis, follow instructions at bottom of my post.
 
Yes/No fields can only have True/False value?
to be safe use Nz(), just in case:

=IIf(Nz([Flagger], False), [Notes], "REDACTED")
=IIf(Nz([Flagger], False), [EDATE], "")
 
Here's a cleaned out version. The main form (PCs) has another checkbox (Print21) which is a flag to print that record. Click "NOTES" to see the Notes, their EDate, and Print Flag for that note. Each record can have multiple notes. Click "PRINT OPTIONS" then PRT 22 to generate report. Report pages
 

Attachments

Here's a cleaned out version. The main form (PCs) has another checkbox (Print21) which is a flag to print that record. Click "NOTES" to see the Notes, their EDate, and Print Flag for that note. Each record can have multiple notes. Click "PRINT OPTIONS" then PRT 22 to generate report. Report pages
Nothing attached? :(
 
Well the report tells you what the problem is. You have a circular reference where the source is pointing to the control?
You need to give the controls different names if you are going to do it this way? I prefixed the controls with txt.

1639669864472.png
 
Looks good. BUT, I'm a little confused, where did you prefix txt? Could you possibly upload the fixed version?
Thank you.
 
The controls in the report that are affected with this control source IIF() ?
 
So.. I got it give me the right information, thank you, BUT....
If a record has 4 notes, it's printing 4 copies of the same page (each with all 4 notes).
I'm thinking of just abandoning this "update" ughhh
 
How can a PC have 4 notes?
The relationship is 1 to 1 with ID in each table?

1639677425404.png
 
Let me think... I wrote that part a few years ago.
Okay, the ID in Notes is not a primary. When you're viewing a PC Record and you add a note, it takes the ID of the PC Record. If you look at the NOTES table, there are multiples of an ID. This was so all the Notes for one PC record would have that ID.
I just added the Notes into the PC Report (PRT22) recently, then this week I realized some Notes included Windows Keys or User Name/Passwords. I wanted to keep them in the Notes, but not Print them, so here I am. I know that's a little confusing, it is to me.
 
Ignore the above post. I imported the Notes Table, Form and Report from the "Clean" version I uploaded and was changing things in, into (a copy of ) the Production Version and it's now working. Thank you all for all your help.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom