Dlookup issue

D

demosthenispk

Hello,

I am trying to set 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([ph4]="Stock4";dLookUp("SumOfExpr2";"Query5";"[W]=" &
"[Query5].[W]");[SumOfSell out]).

Is it something wrong with the formula or the Dlookup just works
once!!!!

Many thanks

Demosthenis
 
J

Jeff Boyce

I can't tell from your description what the underlying data structure looks
like.

Is there a chance you can use queries to return everything you need, and use
an additional query to join the earlier queries?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

demosthenispk

Many thanks for your quick reply.

It is a great idea but I am afraid of speed problems. I have joined
alot of queries to end up with the data I want...but i will definetely
try it.

Concerning the data there are 2 queries

Query 4 with ph4, W, Expr2
And Query 5 with W Sum of Expr2

What i want to do is when the ph4 value is Stock4 to bring the value
from Query 5 where [Query4][W] = [Query5][W].

I hope is more clear now.




I can't tell from your description what the underlying data structure looks
like.

Is there a chance you can use queries to return everything you need, and use
an additional query to join the earlier queries?

Regards

Jeff Boyce
Microsoft Office/Access MVP




I am trying to set 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([ph4]="Stock4";dLookUp("SumOfExpr2";"Query5";"[W]=" &
"[Query5].[W]");[SumOfSell out]).
Is it something wrong with the formula or the Dlookup just works
once!!!!
Many thanks
Demosthenis- Áðüêñõøç êåéìÝíïõ óå ðáñÜèåóç -

- ÅìöÜíéóç êåéìÝíïõ óå ðáñÜèåóç -

Many thanks for your quick reply.
 
J

Jeff Boyce

I can't quite tell whether you want ONLY the corresponding records when
[ph4] = "Stock4", or if you want something in that case and something else
for the rest.

It seems to me that you could join Q4 and Q5 on [W], then as a selection
criterion under the [ph4] field, indicate "Stock4".

Consider posting the SQL statement of what you are using.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Many thanks for your quick reply.

It is a great idea but I am afraid of speed problems. I have joined
alot of queries to end up with the data I want...but i will definetely
try it.

Concerning the data there are 2 queries

Query 4 with ph4, W, Expr2
And Query 5 with W Sum of Expr2

What i want to do is when the ph4 value is Stock4 to bring the value
from Query 5 where [Query4][W] = [Query5][W].

I hope is more clear now.




I can't tell from your description what the underlying data structure
looks
like.

Is there a chance you can use queries to return everything you need, and
use
an additional query to join the earlier queries?

Regards

Jeff Boyce
Microsoft Office/Access MVP




I am trying to set 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([ph4]="Stock4";dLookUp("SumOfExpr2";"Query5";"[W]=" &
"[Query5].[W]");[SumOfSell out]).
Is it something wrong with the formula or the Dlookup just works
once!!!!
Many thanks
Demosthenis- Áðüêñõøç êåéìÝíïõ óå ðáñÜèåóç -

- ÅìöÜíéóç êåéìÝíïõ óå ðáñÜèåóç -

Many thanks for your quick reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DLookUp for Memo field 1
Use Dlookup in my header 4
Dlookup 7
DLookup Problem 2
Criteria, DLookup, and IIF 1
Dlookup 5
dlookup right from Help not working 2
dlookup - calculated field in group footer 8

Top