Lookup from Field

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

Guest

I have a database that has some tables joined via relationships.
The main table is a customer table, for gathering the first name, last name,
address, etc. Then there are others are linked to it.
What I am wondering...is there a way to have the form check the table after
a first and last name are entered to see if there is already a possible
record that exists for that customer? Even something that would find similar
matches based on both fields, and present option in a pop up form.
Any suggestions?
 
Steve

You can use the dlookup function. Example (untested) below.

Dim varFound as Variant
varFound=dLookup("aField","tblCustomer","Where cSurname = '" & Me.txtSurname
& "' AND cFirstName = '" & Me.txtFirstName & "'")

If not isnull(varFound) then
Duplicate record code.....
End If
 

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

Back
Top