Find Matching Data

  • Thread starter Thread starter Brigham Siton
  • Start date Start date
B

Brigham Siton

Using access 97, I have a form that have the following fields:

PartNo - 5-digit Alphanumeric
Modifer - 2-digit Alphanumeric (If any)
Price - Price container

What I am trying to accomplish is that using a query, after the user enters
the part no & modifier (if any), that a query will lookup a match on a
table. If there is a match, that the table automatically return the price
on the price field.

I know this can be done using a combo box that is bounded to a table. But
can I avoid the combo box and just use some unbounded fields?

Thank you very much.
 
I thought about dlookup but I got 2 values to compare to get the match.

Is this possible with dlookup?

Thanks.
 
Sure - the criteria is like a WHERE clause without the WHERE. Just remember
that the argument is a string. Following is an example using CHr(34) so it
is not as confusing:

vXYZ = DLookup("[Field1]", "Table1", "[Field2]=" & Chr(34) &
"UserEnteredPart" & Chr(34) & "AND [Field3]=" & Chr(34) &
"UserEnteredModifier" & Chr(34) )
 
Great. I will give it a shot.

Thank you very much.




Marty L said:
Sure - the criteria is like a WHERE clause without the WHERE. Just remember
that the argument is a string. Following is an example using CHr(34) so it
is not as confusing:

vXYZ = DLookup("[Field1]", "Table1", "[Field2]=" & Chr(34) &
"UserEnteredPart" & Chr(34) & "AND [Field3]=" & Chr(34) &
"UserEnteredModifier" & Chr(34) )


Brigham Siton said:
I thought about dlookup but I got 2 values to compare to get the match.

Is this possible with dlookup?

Thanks.


table.
But
 
Back
Top