Is it possible to translate a code into text in report ???

W

Wellie

Thanks to those who provided me guidance to transale code to text in the
form. I have the same requirements in generating report. I used the Report
Wizard to create report from a table. The field (jobclass) that contains the
code still shown as number 1,2,3 in the report as it is generated.

Wonder if I can write some code to change each record's code as text ?
For example change 1 to manager, 2 to supervisor, 3 to operator, etc.

if yes, where it should be such that the report shows the translated text
before it is previewed or printed ?

Regards
 
R

Rick Brandt

Wellie said:
Thanks to those who provided me guidance to transale code to text in
the form. I have the same requirements in generating report. I used
the Report Wizard to create report from a table. The field
(jobclass) that contains the code still shown as number 1,2,3 in the
report as it is generated.

Wonder if I can write some code to change each record's code as text ?
For example change 1 to manager, 2 to supervisor, 3 to operator, etc.

if yes, where it should be such that the report shows the translated
text before it is previewed or printed ?

Regards

If the text versions are stored in a different table then add that table to the
query used by the report so you can pull the text in. If they are not in a
table and really are values starting with 1 then you can use the Choose
function...

=Choose([jobclass], "manager", "supervisor", "operator")
 
N

NewAccessUser

I opened the report and Design view, selected the field, then then click
Property. In the Control Source of the Data tab, I changed "Jobclass" to
=Choose([jobclass], "manager", "supervisor", "operator") as suggested. I
then ran the report, I got "#Error".

Am I changing it in the right place ?

Rick Brandt said:
Wellie said:
Thanks to those who provided me guidance to transale code to text in
the form. I have the same requirements in generating report. I used
the Report Wizard to create report from a table. The field
(jobclass) that contains the code still shown as number 1,2,3 in the
report as it is generated.

Wonder if I can write some code to change each record's code as text ?
For example change 1 to manager, 2 to supervisor, 3 to operator, etc.

if yes, where it should be such that the report shows the translated
text before it is previewed or printed ?

Regards

If the text versions are stored in a different table then add that table to the
query used by the report so you can pull the text in. If they are not in a
table and really are values starting with 1 then you can use the Choose
function...

=Choose([jobclass], "manager", "supervisor", "operator")
 
D

Dirk Goldgar

NewAccessUser said:
I opened the report and Design view, selected the field, then then
click Property. In the Control Source of the Data tab, I changed
"Jobclass" to =Choose([jobclass], "manager", "supervisor",
"operator") as suggested. I then ran the report, I got "#Error".

Am I changing it in the right place ?

If the text box control on the report is currently named "Jobclass",
change that name to "txtJobclass" -- or some other name that isn't the
name of a field in the report's recordsource.
 

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