Can you replace values on report?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Say I have a table with 4 fields:
Jobid <autonumber> <key>
Jobname <text>
Jobcost <currency>
Costknown <yes/no>

After entering data to this table, is there a way to print a report showing
Jobname and Jobcost, and replace the Jobcost field with the word "unknown"
if Costknown = "no"?
 
Open your report in design view then in your textbox for jobcost, paste the
following instead of the name of the jobcost field. Just in case it works
backwards, change the 0 to -1. But, I think I have it straight--just
wouldn't place any heavy bets on it.

Mike Pippins

=Iif([Costknown]=0,"unknown",[jobcost])
 
Eric

In addition to the responses you've received pointing to making changes in
your report definition, you could also base your report on a query of the
table, and do the conversion you're describing within the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I must be missing something. I put in 4 test records, pasted that into the
Control Source field for display of Jobcost, and got:
UnKnown
#Error
#Error
#Error

Klatuu said:
In the control on your report:

=IIf([CostKnown], [JobCost], "UnKnown")

Eric said:
Say I have a table with 4 fields:
Jobid <autonumber> <key>
Jobname <text>
Jobcost <currency>
Costknown <yes/no>

After entering data to this table, is there a way to print a report
showing
Jobname and Jobcost, and replace the Jobcost field with the word
"unknown"
if Costknown = "no"?
 
Back
Top