dlookup syntax on self join

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Next MakeFrom: DLookUp("[MakeFrom]","2","[FramePartID.] = " & [FramePartID]+1)
the table is "frame make from" with a field "makeFrom"
the alias on the second is "2"
FramePartID can refer to both tables (it tells me) how should i write the
above statement so that it knows which table to use?
--
 
The Dlookup should be
Dlookup("FieldName","TableName","Criteria")

So try

Next_MakeFrom: DLookUp("[MakeFrom]","[frame make from]","[FramePartID] = " &
[FramePartID]+1)
 
framePartID is on 2 tables (a self join) how should i write it so that it
knows which one? i get an error message saying it could refer to more than
one place

thanks for your help
--



Ofer Cohen said:
The Dlookup should be
Dlookup("FieldName","TableName","Criteria")

So try

Next_MakeFrom: DLookUp("[MakeFrom]","[frame make from]","[FramePartID] = " &
[FramePartID]+1)

--
Good Luck
BS"D


turkey said:
Next MakeFrom: DLookUp("[MakeFrom]","2","[FramePartID.] = " & [FramePartID]+1)
the table is "frame make from" with a field "makeFrom"
the alias on the second is "2"
FramePartID can refer to both tables (it tells me) how should i write the
above statement so that it knows which table to use?
 
In that case

Next_MakeFrom: DLookUp("[MakeFrom]","[frame make from]","[FramePartID] = " &
[Enter here the TableName].[FramePartID]+1)

--
Good Luck
BS"D


turkey said:
framePartID is on 2 tables (a self join) how should i write it so that it
knows which one? i get an error message saying it could refer to more than
one place

thanks for your help
--



Ofer Cohen said:
The Dlookup should be
Dlookup("FieldName","TableName","Criteria")

So try

Next_MakeFrom: DLookUp("[MakeFrom]","[frame make from]","[FramePartID] = " &
[FramePartID]+1)

--
Good Luck
BS"D


turkey said:
Next MakeFrom: DLookUp("[MakeFrom]","2","[FramePartID.] = " & [FramePartID]+1)
the table is "frame make from" with a field "makeFrom"
the alias on the second is "2"
FramePartID can refer to both tables (it tells me) how should i write the
above statement so that it knows which table to use?
 
Back
Top