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

Performing DLookUp in a query field?

P: n/a
MLH
I have a query that looks up records in tblReturnReceipts
and other related tables. One of the other tables is
tblCorrespondence. The resulting dynaset consists of five
records. Each has a unique [RtnRcptID] field value and
each has a unique [CorrespID] field value.

I would like to add an additional field to the query that
performs a DLookup for some other stuff - using the query's
[CorrespID] value in the DLookup's criteria section. Of course,
I'm having difficulty because I'm unable to reference the query's
[CorrespID] field value inside the DLookup's criteria section.

Anybody have a useful strategy for such a need?
May 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
MLH <CR**@NorthState.net> wrote in
news:40********************************@4ax.com:
I have a query that looks up records in tblReturnReceipts
and other related tables. One of the other tables is
tblCorrespondence. The resulting dynaset consists of five
records. Each has a unique [RtnRcptID] field value and
each has a unique [CorrespID] field value.

I would like to add an additional field to the query that
performs a DLookup for some other stuff - using the query's
[CorrespID] value in the DLookup's criteria section. Of course, I'm having difficulty because I'm unable to reference the query's [CorrespID] field value inside the DLookup's criteria section.

Anybody have a useful strategy for such a need?

'correspID is a number
expr1: Dlookup("fieldname","Lookuptable","correspID = "
& [tblCorrespondence].[correspID & ")"

'correspID is a string
expr1: Dlookup("fieldname","Lookuptable","correspID = """
& [tblCorrespondence].[correspID & """)" 'correspID is a string

Pick the one for your situation
--
Bob Quintal

PA is y I've altered my email address.
May 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.