get report to display custom label rather than numeric data in tex

  • Thread starter Emelina Bumsquash
  • Start date
E

Emelina Bumsquash

i've searched for ages trying to find a similar query already answered but
have had no luck - apologies if i'm using poor terminology, i'm not that good
on access

in a report, one of the the text box fields records 'site' which is coded as
a number 1-8. is it possible to use some sort of code (i'm thinking perhaps
some kind of IIf statement from the looks of other replies) to get the report
to display "Bolton" instead of 1, Burnley instead of 2 and so on?

thanks in advance for help.
 
C

Carl Rapson

Emelina Bumsquash said:
i've searched for ages trying to find a similar query already answered but
have had no luck - apologies if i'm using poor terminology, i'm not that
good
on access

in a report, one of the the text box fields records 'site' which is coded
as
a number 1-8. is it possible to use some sort of code (i'm thinking
perhaps
some kind of IIf statement from the looks of other replies) to get the
report
to display "Bolton" instead of 1, Burnley instead of 2 and so on?

thanks in advance for help.

If those number/name combinations exist in a table, you could use a DLookUp
in the text box's Control Source to display the string instead of the
number. If not, you could use a SELECT CASE statement in the Format event
for whichever report section the text box resides in.

Carl Rapson
 
D

Duane Hookom

The numbers and site names should be in a table of sites. Add this table to
your report's record source and join the number fields. Add the site name
field to your fields in the report so you can display it.

If you don't have a table, you can use a maintenance prone solution like:
=Choose([Site],"Bolton","Burnley","Site 3", .....)
 
E

Emelina Bumsquash

I have put the numbers and names into a table now but i'm still falling at
the first hurdle! how do i add this table to the reports record source? it's
only got one drop down menu for 'record source' as far as i can see and i'm
already using a query as the record source. once i get around this i can try
and work out how to do join the number fields, as you've said.

although the 'maintenance prone solution' sounds good, i can't see how that
ties a given number to the site name and also whereabouts i'd put this code.

apologies for my ignorance - like i said, i'm not that good on access!

Duane Hookom said:
The numbers and site names should be in a table of sites. Add this table to
your report's record source and join the number fields. Add the site name
field to your fields in the report so you can display it.

If you don't have a table, you can use a maintenance prone solution like:
=Choose([Site],"Bolton","Burnley","Site 3", .....)
--
Duane Hookom
Microsoft Access MVP


Carl Rapson said:
If those number/name combinations exist in a table, you could use a DLookUp
in the text box's Control Source to display the string instead of the
number. If not, you could use a SELECT CASE statement in the Format event
for whichever report section the text box resides in.

Carl Rapson
 
D

Duane Hookom

You should be able to open your report's record source query in design view
and add your new table. Join the "numbers" fields and add the "name" field to
the grid. This allows you to display the name in your report.

--
Duane Hookom
Microsoft Access MVP


Emelina Bumsquash said:
I have put the numbers and names into a table now but i'm still falling at
the first hurdle! how do i add this table to the reports record source? it's
only got one drop down menu for 'record source' as far as i can see and i'm
already using a query as the record source. once i get around this i can try
and work out how to do join the number fields, as you've said.

although the 'maintenance prone solution' sounds good, i can't see how that
ties a given number to the site name and also whereabouts i'd put this code.

apologies for my ignorance - like i said, i'm not that good on access!

Duane Hookom said:
The numbers and site names should be in a table of sites. Add this table to
your report's record source and join the number fields. Add the site name
field to your fields in the report so you can display it.

If you don't have a table, you can use a maintenance prone solution like:
=Choose([Site],"Bolton","Burnley","Site 3", .....)
--
Duane Hookom
Microsoft Access MVP


Carl Rapson said:
message i've searched for ages trying to find a similar query already answered but
have had no luck - apologies if i'm using poor terminology, i'm not that
good
on access

in a report, one of the the text box fields records 'site' which is coded
as
a number 1-8. is it possible to use some sort of code (i'm thinking
perhaps
some kind of IIf statement from the looks of other replies) to get the
report
to display "Bolton" instead of 1, Burnley instead of 2 and so on?

thanks in advance for help.

If those number/name combinations exist in a table, you could use a DLookUp
in the text box's Control Source to display the string instead of the
number. If not, you could use a SELECT CASE statement in the Format event
for whichever report section the text box resides in.

Carl Rapson
 

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