Need some VBA code help I think....

G

Guest

I am using the "FormatCurrency" expression to display calculated fields in a
query as currency. The field calculations are dependent upon an IIf statement
that dictates that only fields be calculated which match user input (based on
a separate query for that user input).

I get #Errors in every line that is supposed to be Null according to the IIf
statement in both the query and the report that I need to base off of it.

My field calculation reads: INS FEE:
FormatCurrency(IIf([DATEPAID]=[Preliminary Report
Query]![DATEPAID],[Preliminary Report Query 2]![INSURANCE FEE]," "))

Thanks...
 
J

John Spencer

Change the result of the IIF to return NULL instead of a zero-length
string(ZLS). FormatCurrency cannot handle ZLS or other items that it does
not recognize as numbers.

INS FEE:
FormatCurrency(IIf([DATEPAID]=[Preliminary Report Query]![DATEPAID],
[Preliminary Report Query 2]![INSURANCE FEE],NULL))
 

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