Problem with Report (1 Viewer)

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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

  • System Data.pdf
    68.9 KB · Views: 290

June7

AWF VIP
Local time
Today, 10:22
Joined
Mar 9, 2014
Messages
5,423
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:

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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
 

oleronesoftwares

Passionate Learner
Local time
Today, 11:22
Joined
Sep 22, 2014
Messages
1,159
=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.
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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.)
 

oleronesoftwares

Passionate Learner
Local time
Today, 11:22
Joined
Sep 22, 2014
Messages
1,159
IIf([Flagger] = True, "REDACTED", [Notes])
Try something like below
=IIf([checkedfield]="0","Not checked","checked")


checkbox have values 0 and 1 or 0 and -1 depending
0 means it is not checked
 

June7

AWF VIP
Local time
Today, 10:22
Joined
Mar 9, 2014
Messages
5,423
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:22
Joined
May 7, 2009
Messages
19,169
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], "")
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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

  • PCInfo Cleaned.zip
    226.6 KB · Views: 296

Gasman

Enthusiastic Amateur
Local time
Today, 18:22
Joined
Sep 21, 2011
Messages
14,046
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? :(
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
Fixed it. I saved it as a RAR file. Changed to Zip
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:22
Joined
Sep 21, 2011
Messages
14,046
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
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
Looks good. BUT, I'm a little confused, where did you prefix txt? Could you possibly upload the fixed version?
Thank you.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:22
Joined
Sep 21, 2011
Messages
14,046
The controls in the report that are affected with this control source IIF() ?
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:22
Joined
Sep 21, 2011
Messages
14,046
How can a PC have 4 notes?
The relationship is 1 to 1 with ID in each table?

1639677425404.png
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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.
 

vito1010

Registered User.
Local time
Today, 14:22
Joined
Aug 14, 2014
Messages
33
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

Top Bottom