Query IIF function

  • Thread starter Thread starter Evan
  • Start date Start date
E

Evan

I have a Query field: TaxAmt:
Iff([Base]>1,[Base]+([TaxRate]*(([Forms]![frmCrit]![UserInc])-[Low])),[TaxRate]*[Forms]![frmCrit]![UserInc])

I get an error message: undefined function IIF in expression. Should the IIF
function be placed in the critieria row rather than the field row?

Evan
 
Evan said:
I have a Query field: TaxAmt:
Iff([Base]>1,[Base]+([TaxRate]*(([Forms]![frmCrit]![UserInc])-[Low])),[TaxRate]*[Forms]![frmCrit]![UserInc])

I get an error message: undefined function IIF in expression. Should the IIF
function be placed in the critieria row rather than the field row?


Check it again. The expression you posted uses IFF, not
IIF.
 
Thanks. I have another problem: The subform based on the query is generating
#NAME? error in the TaxAmt column. Here's the setup: A form with a textbox
control (user types in a number) as the source for both TaxAmt field and as a
parameter in 2 other fields in the query. The query SQL code:

SELECT C.CountryName, AllFdTxSch.TaxRate,
IIf([Base]>1,[Base]+([TaxRate]*([Forms]![frmCrit]![UserInc]-[Low])),[TaxRate]*[Forms]![frmCrit]![UserInc]) AS TaxAmt, AllFdTxSch.Base
FROM C INNER JOIN AllFdTxSch ON C.CountryID = AllFdTxSch.CountryID
WHERE (((AllFdTxSch.Low)<=[Forms]![frmCrit]![UserInc]) AND
((AllFdTxSch.High)>[Forms]![frmCrit]![UserInc]));

Any ideas on how to rectify this?

Thanks Evan
 
Evan said:
Thanks. I have another problem: The subform based on the query is generating
#NAME? error in the TaxAmt column. Here's the setup: A form with a textbox
control (user types in a number) as the source for both TaxAmt field and as a
parameter in 2 other fields in the query. The query SQL code:

SELECT C.CountryName, AllFdTxSch.TaxRate,
IIf([Base]>1,[Base]+([TaxRate]*([Forms]![frmCrit]![UserInc]-[Low])),
[TaxRate]*[Forms]![frmCrit]![UserInc]) AS TaxAmt, AllFdTxSch.Base
FROM C INNER JOIN AllFdTxSch
ON C.CountryID = AllFdTxSch.CountryID
WHERE (((AllFdTxSch.Low)<=[Forms]![frmCrit]![UserInc]) AND
((AllFdTxSch.High)>[Forms]![frmCrit]![UserInc]));

I don't see anything in the query that would cause it.
Double check the spelling of the TaxAmt field in the text
box's Control Source
 
Back
Top