M
MStressed
I am trying to use a DLookUp function in my query, which will be based on two
sets of criteria. Here is what I have in "simple" terms, I will try to
explain it...
Everything has functioned properly. I am now trying to add a column in the
query that will be based on certain criteria from a separate table.
If I write it like this:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName]=" &
[Table2]![fieldName]) the value becomes as expected.
If I write it like this:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName2]>" &
[Table2]![fieldName2]) the value becomes as expected.
If I try to combine the two:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName]=" &
[Table2]![fieldName] And "[Table1]![fieldName2]>" & [Table2]![fieldName2]) I
get #Error.
What I am trying to accomplish is this. I want to look up in a table a
price where "Variable A" falls between a range(two fields built in the table)
and is of specific type(also a field built in the table).
'Product A' is 45" long. I want to find in my "chart"(table) the price of
'Product A' where 45" falls into that specific range (36" - 48") AND based on
what 'Product A' is. For instance, if 'Product A' is "Metal" and is 45"
long, it's price would be $35.00. If 'Product A' is "Metal" and is 74" long,
it's price would be $65.00. If 'Product A' is "Wood" and is 45" long, it's
price would be $40.00.
I hope I explained this correctly. I am thinking the DLookUp is the way to
go, I just can't get the syntax correct. Also, all fields are number type,
including the product type(ID field). Again, I can get it to work with one
condition, but not with two.
Any help is much appreciated.
sets of criteria. Here is what I have in "simple" terms, I will try to
explain it...
Everything has functioned properly. I am now trying to add a column in the
query that will be based on certain criteria from a separate table.
If I write it like this:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName]=" &
[Table2]![fieldName]) the value becomes as expected.
If I write it like this:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName2]>" &
[Table2]![fieldName2]) the value becomes as expected.
If I try to combine the two:
DLookUp("[Table1]![fieldName]","Table1","[Table1]![fieldName]=" &
[Table2]![fieldName] And "[Table1]![fieldName2]>" & [Table2]![fieldName2]) I
get #Error.
What I am trying to accomplish is this. I want to look up in a table a
price where "Variable A" falls between a range(two fields built in the table)
and is of specific type(also a field built in the table).
'Product A' is 45" long. I want to find in my "chart"(table) the price of
'Product A' where 45" falls into that specific range (36" - 48") AND based on
what 'Product A' is. For instance, if 'Product A' is "Metal" and is 45"
long, it's price would be $35.00. If 'Product A' is "Metal" and is 74" long,
it's price would be $65.00. If 'Product A' is "Wood" and is 45" long, it's
price would be $40.00.
I hope I explained this correctly. I am thinking the DLookUp is the way to
go, I just can't get the syntax correct. Also, all fields are number type,
including the product type(ID field). Again, I can get it to work with one
condition, but not with two.
Any help is much appreciated.