Find Matching Data

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.
 
B

Brigham Siton

I thought about dlookup but I got 2 values to compare to get the match.

Is this possible with dlookup?

Thanks.
 
M

Marty L

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) )
 
B

Brigham Siton

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
 

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

Top