AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
why don't you just, convert the input text to lowercase and convert the data from the database into lowercase then compare the two of them...
I think you can optimize your code,
you may change your SELECT statment into
.Open "SELECT * FROM records WHERE name=" & Trim$(Text9.Text)
so that you don't have to use a loop just to compare all the records within your query result..
then you can check the result by:
If rst.BOF and rst.EOF = True Then 'returns true when the results are empty, meaning the input text has no matching records within the query.
MsgBox "No Duplicate", vbCritical, "Duplicate Name"
Text1.SetFocus
Exit Sub
PoisonedHeart
Junior Poster in Training
57 posts since Jul 2009
Reputation Points: 14
Solved Threads: 14