473,657 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Performing DLookUp in a query field?

MLH
I have a query that looks up records in tblReturnReceip ts
and other related tables. One of the other tables is
tblCorresponden ce. 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
1 2414
MLH <CR**@NorthStat e.net> wrote in
news:40******** *************** *********@4ax.c om:
I have a query that looks up records in tblReturnReceip ts
and other related tables. One of the other tables is
tblCorresponden ce. 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("fieldn ame","Lookuptab le","correspI D = "
& [tblCorresponden ce].[correspID & ")"

'correspID is a string
expr1: Dlookup("fieldn ame","Lookuptab le","correspI D = """
& [tblCorresponden ce].[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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
20776
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one site could have many units. How do I have the DLookUp field value change to a newly calcuated field when I navigate through the units? please see example below: On the Form: A site can have many units.
6
2330
by: JLM | last post by:
What am I missing here? I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each "class code." Key field is "class code." I want a text box to be populated with the "title" which corresponds to the "class code" which I enter in the form. The control source for the text box is:
7
2253
by: Tony Williams | last post by:
Does DLookup work in an expression in a query? I have this expression -(DLookUp("","tblmaintabs","= ")) Which works fine as a calculated control on a form but when I try to use it in a query as an expression I don't get any result. I want to use the Sum of the result in a query on which I will base a report. TIA Tony
0
1629
by: Tony Williams | last post by:
I have posted a number of posts in the Access newsgroups concerning my problem with DLookup. I have had a number of the experts with helpful suggestions but I still can't get it to work! This is what I am trying to do: I have a table called tblmaintabs which holds year to date data for a number of companies which they supply on a quarterly basis. The field txtDomfacsoleqtr is one of the fields that holds part of this data. The...
8
4316
by: Christine Henderson | last post by:
I have a problem using the above function in the following simplified circumstance: In the lookup table called "Klms Travelled" I have 3 fields, eg: Receiver Name Receiver Suburb Klms Distance Jones Melbourne 500 Harrison Sydney 200 Ford Brisbane 700 Jones ...
2
5063
by: bobabooey2k | last post by:
I have an update query with one field having in its "Update to" cell a DLookup statement. This query takes 2-3 minutes on 3000 records. Can I avoid dlookup here using multiple queries? An underlying subquery to this Update query involves a MAX function on a date field, which is then used in the DLookup statement. Any help appreciated. Thanks Richard
2
9037
by: sfrvn | last post by:
I am embarrassed to say I cannot make this work. Recently upgraded to Access 2003, but do not know if that part of problem (AKA 'syntax change'). Would someone be kind enough to lead me by the hand? Table name: LUtblProvider Table field names: provPKID, name, company, type, phone Table name: tblRef Table field names: refPKID, prov, event, src
3
2449
by: hrreece | last post by:
I am trying to use the Dlookup expression in a macro to pull the value from the "Price" field in the following query. The query works fine and the Dlookup function did as well until I added a new field to the "Contracts" table called "ContractYear". SELECT Contracts.ID, Contracts.Commodity, Contracts.Date, Contracts.ContractYear, Contracts.Option, Contracts., Contracts.Bushels, Contracts.Price, Contracts. FROM Customer INNER JOIN Contracts...
3
1387
by: Demosthenis | last post by:
Hello, I am trying to seto up a Dlookup in a query. My Dlookup field will retrieve data from a second query. The match criteria is the W field. This dlookup up process has to retrieve 24 different values from the second query (Query5). Unfortunatelly the function always brings the first value of the 2nd query for all the 24 fields. My formula is the Expr10: IIf(="Stock4";dLookUp("SumOfExpr2";"Query5";"=" & ".");). Is it something...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.