Expression

  • Thread starter Thread starter Gsurfdude
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top