Expression

G

Gsurfdude

I have a report with a text box on it. I have the control source set to this
rather than a field from the table.
=IIf([Temp_445]![ROUTE_TYPE]=1,[Temp_445]![Mileage],0)

How come this prompts me for an input parameter?

both route_type and mileage are numbers in the table.
 
M

Marshall Barton

Gsurfdude said:
I have a report with a text box on it. I have the control source set to this
rather than a field from the table.
=IIf([Temp_445]![ROUTE_TYPE]=1,[Temp_445]![Mileage],0)

How come this prompts me for an input parameter?

both route_type and mileage are numbers in the table.


Whatever you are being prompted to enter is not exactly the
same as the field name in its table.
 
A

Allen Browne

Assuming that Temp_445 is the table that feeds the records to the report,
try:

1. Omit the table name, i.e.:
=IIf([ROUTE_TYPE] = 1, [Mileage], 0)


2. Make sure you have text boxes named ROUTE_TYPE and Mileage on your
report. You can set visible = No if you want to hide them, but in some
circumstances, Access doesn't bother fetching fields that are not directly
used on the report.

3. If you're still stuck, create a query using your Temp_445 table, and put
the expression in the query. Then use this query as the Record Source for
your report, and you have the field you need to put on your report.
 

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