Using Dlookup in a query

noccy

Registered User.
Local time
Today, 19:02
Joined
Aug 19, 2003
Messages
67
Hello!

I have problems when I try to use Dlookup in a query. Can anyone tell me what I might be doing wrong?

My qyery is called qryData

I have one table with customerID and CustomerName, and one table with CustomerID and CustomerAdress

The query qryData is supposed to be [CustomerID, CustomerAdress, CustomerName]

I get CustomerID and CustomerAdress from tblAdress, and I want to use Dlookup to get the right CustomerName from tblNames.


This is what i have: Name: Dlookup("[CustomerName]", "[tblNames]", "[CustomerID] = '" & [qryData].[CustomerID] & "'")


This gives me a syntax error.....


Help.....


noccy
 
Why is the Address in a separate table? It would normally be in the same table as the customer details. However to get the address from the other table just add the second table to the query and join the common field
 
Well I was just using this as an example as the real tables are a bit more complicated....

I need help on the Dlookup query...:D
 
Ok, here are the real tables....

Table1 : [Date, Time, SenderAccountNumber, ReceiverAccountNumber]
Table2 : [AccountNumber, AccountOwner]

Query I want to build: [Date, Time, SenderAccountNumber, OwnerSenderAccount, ReceiverAccountNumber, OwnerReceiverAccount]

noccy :)
 
The fields SenderAccountNumber and ReceiverAccountNumber are the same as AccountNumber
 

Users who are viewing this thread

Back
Top Bottom