Change Labels in Reports

D

David Ehrenreich

Hello,

I have a combo box based on a table in a few of my forms
for users to use. I also have an options screen which
the administrator can change the field values in the
list. Since this list can be change this causes problems
with the reports. What I would like is have the label
names in the report to be based off the list values. I
been thinking how to do this, but I don't know how to
code it. I could be on the wrong track, but I think if
the table has two fields. One of the fields with the
list values and the other field with a number. I think
it could work like this. The first label would display
first List value, because the number value is 1. The
second label would display list value 2, because the
number value is 2, and so on.
I hope this make sense.
Any help would be great.

Thanks Ahead
David Ehrenreich
 
A

Allen Browne

Simplest solution would be to create a small table with 2 fields:
- the number
- the text matching that number.

Then include that table in the query that feeds the report. You now have the
text field, and can use a text box to show the text. No code. No messing
around.

If that is not possible, you could use a text box on the report, and use the
Switch() function in its ControlSource.
 
G

Guest

Thank you for the reply, but I think I'm missing
something. Ok I have a table with two feilds a Text
Field for the combox names and then a field with the
numbers. Then I use a text box instead of a label in the
report. This is where I lose you. How do I have the
different combobox values for each textbox. I'm sorry if
I'm not explaining this well.

Thank you so far
David Ehrenreich
 
A

Allen Browne

Base the report on a query.

In the existing table, you already have a field that has the numbers, so in
query design you will join that table to the new lookup table. Drag the text
field from the lookup table into the query grid. Now you have the text field
in your query as well, so you can put this text field onto your report.

Have I understood your need correctly?
 
G

Guest

Hello,

I really like to thank you for your help so far. I still
dont understand how to use a table lookup for what I
need. Here is where I am and what I still need. Ok their
is a options form where the administrator enters in what
test's are offered. This is a subform based off a table
whith two columns one for the test title and on with a
number. Now in the student's form their is a combobox
that is also based off that table. The student selects
the test title and then the number for that test is
stored for that test. The numbers will never change but
the test title could. This solves half of my reporting
problem. Since it stores a number I can set the report
to count say how many 5's their were. So now here is
where I cant figure this out. In the report I need labels
(Text boxes which ever work) for each column. I wont
know the test title for those labels, so I would like it
to lookup the number and then display whatever test title
is in that row.

I hope you still have some patience to help.

Thank you so far
David Ehrenreich
 
A

Allen Browne

Hi David.

You say:
The subform is based off a table with 2 columns ...

Is your report based on a query? If not, create a query that contains the
main table and also this lookup table. The text field of the lookup table
can then be in the query, and therefore in the report.

If you still cannot get that working, another alternative is to use
DLookup() in the control source of the text box on your report. This will be
a much less efficient approach. For help with supplying the 3 things
DLookup() needs, see:
Getting a value from a table: DLookup()
at:
http://members.iinet.net.au/~allenbrowne/casu-07.html
 
Top