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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate records

Status
Not open for further replies.

JayBall

IS-IT--Management
Jul 13, 2001
25
0
0
GB
I need to setup some code which looks for duplicates when records are entered. If the first line of an address matches I need it to flag up a message box. Any ideas?

Thanks, Jason.
 
Yeah create a dulpicate Query using the wizard and past that SQL Statement into your VBA code. Let Access work for you. DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
In the After Update event of your address1 text box, put something like this:

If Me!Address1 = DLookup("Address1", "AddressTable") then
Msgbox "Duplicate address being entered."
End if

Uncle Jack
 
Try setting the "Validation Rule" for the Address1 text field, with the code dlookup("[Address1]", "AddressTable", "[Address1] = " & [Address1]) Is Null

and the "Validation Text" like "Address Found! Try another one"

*** The final "Is Null" is separated by a single space. That´s is different that "IsNull". Both are functional but with different results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top