Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Fields

Status
Not open for further replies.

hsotb

IS-IT--Management
May 8, 2003
19
US
I have a form that has a field called Names, I would like to know how to (upon input) have that field compare with another field (different table). The reason is this:

When a user enter in the name of Frank Doe , I want to make sure that Frank Doe doesnt exsist in the name field of the other table. And if it does have an error box stating this.

Any suggestion would help..

Thank you
 
One approach is to use DLookUp() in the Before Insert Event? If DLookup finds a record, then spit out a messagebox and not sure if u can issue a CanelEvent or something?

Another is to write a function that executes a Select 1 from OtherTable Where UserName = form!Field.Value... Also in Before Insert.

htwh,


Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
is "Frank Doe" an entry in the table like [Name] or it's 2 entry in the table [FirstName] and [LastName] ?

did you consider than 2 persons can have the same name?
 
Frank Doe is the entry in the lookup table. There is no [LastName] or [FirstName], it is just [name]. It would have to be a 100% match in order for it to flag the person that is entering it.

So in other words , If I was to enter Frank Doe and the other table doesnt have a Frank Doe , you may just continue, but if it did have a Frank Doe , you would receive the error box.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top