ACC: Formatting Immediate IF (IIF) Statements in ReportsID: Q106184
|
Moderate: Requires basic macro, coding, and interoperability skills.
If a report that is based on a query contains a field that includes a null
value from an Immediate If (IIf) statement, you will not be able to
format the field properly on the report.
There are two ways to work around this behavior. The first method is to
format the IIf expression in the query. You can add a format statement to
the beginning of the IIf statement. For example, the following statement
would add formatting to the field:
Format(IIF([freight] = 32.07,[freight],null),"$0.00")
=Format(IIF([freight]=32.07,[freight],null),"$0.00")
This behavior no longer occurs in Microsoft Access version 7.0.
Query: TestIIF
---------------------------------------------------
Field: Company Name
Field: Order ID
Field: Freight
Field: Shipped Date
Field: MyField: IIf([freight]=32.07,[freight],null)
Keywords : kbusage GnlFrmt
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: March 27, 1999