By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,234 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,234 IT Pros & Developers. It's quick & easy.

Format report using crosstab query

AccessIdiot
100+
P: 493
Hello all,

I have a report that is based on a crosstab query. One of the fields in the crosstab query is based on a query. It is a coded value. When I look at the crosstab query it displays the value. But when I look at the report I get the coded value.

For example, in the table it is;

1 apple
2 orange
3 banana

When I look at the crosstab query it displays: apple, orange, banana
When I look at the report it displays: 1, 2, 3

Any ideas?

thanks!
Jan 2 '08 #1
Share this Question
Share on Google+
2 Replies


puppydogbuddy
Expert 100+
P: 1,923
Hello all,

I have a report that is based on a crosstab query. One of the fields in the crosstab query is based on a query. It is a coded value. When I look at the crosstab query it displays the value. But when I look at the report I get the coded value.

For example, in the table it is;

1 apple
2 orange
3 banana

When I look at the crosstab query it displays: apple, orange, banana
When I look at the report it displays: 1, 2, 3

Any ideas?

thanks!
Here is one way you can resolve your problem: assuming for purposes of illustration, your textbox with coded value is named txtCode, and its control source is fldCode. You need to replace the illustrative names with the actual names in your application.
1. Move txtCode to a place in the same vicinity, where you can hide it by setting its visible property to false after testing is complete.
2. Place another textbox where txtCode used to be before you moved it. Name the new textbox something like txtDescription. This assumes the underlying field name in the table is fldDescription.
3.Place the following expression in the control source property of txtDescription. The syntax used assumes that fldCode is numeric. If it isn't, the syntax will have to be changed.
= DLookup("[fldDescription]", "YourTable", "[fldCode] = " & Report!fldCode)
Jan 3 '08 #2

AccessIdiot
100+
P: 493
That worked beautifully, thank you!
Jan 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.