Lookup value in a table

G

Guest

I am using a form for data entry which is bound to tlbLetter. After entering
a loan number in a field in the form , I want a message box to tell me if the
loan number is in a different table called tblImport. Can someone help me
with the code on this? Thanks...
 
D

Duncan Bachen

Janet said:
I am using a form for data entry which is bound to tlbLetter. After entering
a loan number in a field in the form , I want a message box to tell me if the
loan number is in a different table called tblImport. Can someone help me
with the code on this? Thanks...

You can use the Dlookup Function in the After Update event of the text
control on the form.

Sample:

If DLookup("[LoanID]","[tblImport]","[LoanNumber]=" &
txtLoanNumberOnForm) Then
MsgBox "Already Exists"
End If
 
G

Guest

This is just what I was looking for. THanks a million.

Duncan Bachen said:
Janet said:
I am using a form for data entry which is bound to tlbLetter. After entering
a loan number in a field in the form , I want a message box to tell me if the
loan number is in a different table called tblImport. Can someone help me
with the code on this? Thanks...

You can use the Dlookup Function in the After Update event of the text
control on the form.

Sample:

If DLookup("[LoanID]","[tblImport]","[LoanNumber]=" &
txtLoanNumberOnForm) Then
MsgBox "Already Exists"
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

Top