Proper Syntax Required

T

TeeSee

My form is populated by a query. In the query there are two calculated
fields -- NetCost and NeNetCost. The following IIF's are in text
boxes. The first one with the string responses works as expected so
the logic seems to be okay but I keep getting #Name? error in the text
box of the second one. Could someone please explain what my issue is.
Thanks

=IIf(IsNull([NewNetCost]),("It is Null"),("HasValue")) ****** This is
just a test scenario *******

=IIf(IsNull([NewNetCost]),[NetCost],[NewNetCost])
 
F

fredg

My form is populated by a query. In the query there are two calculated
fields -- NetCost and NeNetCost. The following IIF's are in text
boxes. The first one with the string responses works as expected so
the logic seems to be okay but I keep getting #Name? error in the text
box of the second one. Could someone please explain what my issue is.
Thanks

=IIf(IsNull([NewNetCost]),("It is Null"),("HasValue")) ****** This is
just a test scenario *******

=IIf(IsNull([NewNetCost]),[NetCost],[NewNetCost])

1) Make sure the name of this control is not "NetCost".

2) Access throws a #Name error when it cannot identify a field used in
it's control source expression.
As [NetCost] is the only field used in this expression that is not
also in the first expression, I would suspect that there is a
difference in spelling between the query field [NetCost] and the field
name used in the expression.

3) You somehow unchecked the [NetCost] column's show checkbox in the
query and therefore the [NetCost] field is not available in the form's
recordsource.
 
T

TeeSee

My form is populated by a query. In the query there are two calculated
fields -- NetCost and NeNetCost. The following IIF's are in text
boxes. The first one with the string responses works as expected so
the logic seems to be okay but I keep getting #Name? error in the text
box of the second one. Could someone please explain what my issue is.
Thanks
=IIf(IsNull([NewNetCost]),("It is Null"),("HasValue")) ****** This is
just a test scenario *******
=IIf(IsNull([NewNetCost]),[NetCost],[NewNetCost])

1) Make sure the name of this control is not "NetCost".

2) Access throws a #Name error when it cannot identify a field used in
it's control source expression.
As [NetCost] is the only field used in this expression that is not
also in the first expression, I would suspect that there is a
difference in spelling between the query field [NetCost] and the field
name used in the expression.

3) You somehow unchecked the [NetCost] column's show checkbox in the
query and therefore the [NetCost] field is not available in the form's
recordsource.

Thanks Fred .....
1) Make sure the name of this control is not "NetCost".
It WAS!
 

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