Display IDs as names on report (1 Viewer)

add1989

Registered User.
Local time
Today, 14:22
Joined
Jun 3, 2010
Messages
25
I have a query that returns

Date StaffID CustomerID Subject
23/06/10 1001 2002 Blah

My staff table obviously has the colums: ID, Fname, Sname.

My customer table has: ID, businessName.

When I print off a report, I want the report to show names instead of IDs.

What is the best way to do this?

Adam
 

rainman89

I cant find the any key..
Local time
Today, 09:22
Joined
Feb 12, 2007
Messages
3,015
attach the staff and customer table to your query then pull the names into your query.. It will be easier then using a lookup on your report.
 

add1989

Registered User.
Local time
Today, 14:22
Joined
Jun 3, 2010
Messages
25
I just tried putting:

=DLookUp("[Business]","[Customers]","[CustomerID]=")

into the control source for the report field, but I just got '#error'

How would I do what you say with the query?

Forgive me it has been a while since I have done databases. :(

Adam
 

rainman89

I cant find the any key..
Local time
Today, 09:22
Joined
Feb 12, 2007
Messages
3,015
Add the tables to the query, and if you have the joins correct you should just be able to pull the names out of the 2 tables..
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 14:22
Joined
Sep 7, 2009
Messages
1,819
The reason your dlookup isn't working is that you haven't specified a value for CustomerID.

But the best way to do it is: create a query in design view with both the above tables. Make a join between the two ID Fields and drag down FName, SName, and Businessname. Presto!
 

Users who are viewing this thread

Top Bottom