Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2006

Tip: Looking for answers? Try searching our database.

a "different" conditional report field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JC - 16 Feb 2006 16:58 GMT
I am trying to conditionally print a field on a report based on the
value of another field in the query that the report is based on.
In the Control Source for SerialB I have typed:
 = IIF(nz(QtyB) > 0," ",SerialB)
On preview of the report I get #Error in that field every time QtyB is
NOT greater than 0.
If I change the code to read:
 = IIF(nz(QtyB) > 0," ","9")
the blank shows up where it should and the 9 shows up where it should.

Can someone please tell me how to make this work?  Thanks
 - jc -
Bill (The Original) - 16 Feb 2006 20:23 GMT
Create a field in the query using your formula.
e.g., createdfield: = IIF(nz(QtyB) > 0," ",SerialB).
Then use createdfield in the report.

Or

Put SerialB in the report and hide it from view.
(Make the box tiny or change the font color)

If you refer to SerialB in a formula as its control source in a report,
then you must have SerialB somewhere else in the report for the formula
to reference.  Formulas with self referential components generally end
up
as non functioning circular references.  Is that confusing enough?
JC - 17 Feb 2006 12:28 GMT
Bill, Thank you!  Adding the created fields in the underlying query
worked GREAT! - BUT - I could not get the other solution to work.  I
tried putting both fields on the report, but it still gave the #Error.
I understand what you are saying about self referential components, but
it does seem like it "ought" to work.  No matter - I am moving on since
you have given me a solution that works.  Thanks again.

 - jc -
PS - I LOVE this forum. - so much knowledge right at my fingertips...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.