Calculated Controls - TextBox

C

chris1

I have report based on a table and a form. The Form's Data Entry property is
set to "Yes" and the Report's Record Source is a query based on the table
linked by the primary key inputted by the user on the form. The report
essence picks up the newly appended record only.

I am able to use all the fields and supply the newly appended fields on the
report. I use an unbound textbox for a field that uses the expression:
=iif([name of field]=0," ",[name of field]).

I receive an #Error message. The [name of field] field's data type is a
number (single). If I supply the arguments 1 and 2 respectivley for the True
and False arguments then it works.

I tried this on another "dummy" database and the formula worked except for
the original one above. What am I doing incorrectly? Is it a property that I
need to set?

Please help, thank you!
 
A

Allen Browne

Since [name of field] is a Number type field, you are confusing Access by
assigning a space to it. You would not be able to store a space in a number
field.

Instead assign the value Null, i.e.:
=iif([name of field]=0, Null, [name of field])

Also, make sure the Name property of this text box is not the same as name
of field. Access gets confused if a control has the same name as a field,
but is bound to something else.
 

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