DLOOKUP Trouble

K

Kuraige

Hi All

hope someone can solve this, as its driving me nuts. I cant get a these two
dlookup statments in to one, i know its a syntax error, but i can't figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay
 
F

fredg

Hi All

hope someone can solve this, as its driving me nuts. I cant get a these two
dlookup statments in to one, i know its a syntax error, but i can't figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay

Combined into what?
You're looking at 2 different DLookUps with different criteria placed
into 2 different variables.
You need 2 different DLookUps. Nothing wrong with that.
 
K

Kuraige

Sorry, maybe i didn't explain it correctly, i need both of the criteria in
the same Dlookup so i can find the correct record, but when i join the two
dlookup statements i cant seem to get the syntax correct.

Thanks for your help

fredg said:
Hi All

hope someone can solve this, as its driving me nuts. I cant get a these two
dlookup statments in to one, i know its a syntax error, but i can't figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay

Combined into what?
You're looking at 2 different DLookUps with different criteria placed
into 2 different variables.
You need 2 different DLookUps. Nothing wrong with that.
 
K

Kuraige

I tried this and i recieve type mismatch

OrgCost4 = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'" And "[TRACKING
NUMBER]='" & MySet(13) & "'")

Thanks again

fredg said:
Hi All

hope someone can solve this, as its driving me nuts. I cant get a these two
dlookup statments in to one, i know its a syntax error, but i can't figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay

Combined into what?
You're looking at 2 different DLookUps with different criteria placed
into 2 different variables.
You need 2 different DLookUps. Nothing wrong with that.
 
D

Duane Hookom

Try:

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"' AND [CDESC] = 'FRT'")


--
Duane Hookom
MS Access MVP

Kuraige said:
Sorry, maybe i didn't explain it correctly, i need both of the criteria in
the same Dlookup so i can find the correct record, but when i join the two
dlookup statements i cant seem to get the syntax correct.

Thanks for your help

fredg said:
Hi All

hope someone can solve this, as its driving me nuts. I cant get a these
two
dlookup statments in to one, i know its a syntax error, but i can't
figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" &
MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay

Combined into what?
You're looking at 2 different DLookUps with different criteria placed
into 2 different variables.
You need 2 different DLookUps. Nothing wrong with that.
 
K

Kuraige

That works perfectly thanks a million

Duane Hookom said:
Try:

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" & MySet(13) &
"' AND [CDESC] = 'FRT'")


--
Duane Hookom
MS Access MVP

Kuraige said:
Sorry, maybe i didn't explain it correctly, i need both of the criteria in
the same Dlookup so i can find the correct record, but when i join the two
dlookup statements i cant seem to get the syntax correct.

Thanks for your help

fredg said:
On Tue, 1 Aug 2006 13:28:01 -0700, Kuraige wrote:

Hi All

hope someone can solve this, as its driving me nuts. I cant get a these
two
dlookup statments in to one, i know its a syntax error, but i can't
figure it
out for the life of me

Please any help would be appricated

ORGCOST2 = DLookup("[COST]", "IMPORT", "[TRACKING NUMBER]='" &
MySet(13) &
"'")

ORGCOST = DLookup("[COST]", "IMPORT", "[CDESC] = 'FRT'")

they both work seperatly but not combined

Thanks in advance

Jay

Combined into what?
You're looking at 2 different DLookUps with different criteria placed
into 2 different variables.
You need 2 different DLookUps. Nothing wrong with that.
 
Top