[AccessD] Prevent Duplicates

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Thu Apr 22 10:06:59 CDT 2004


Virginia:

Does VenNumber contain a valid numeric value at that point?

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com


----- Original Message ----- 
From: "Hollis,Virginia" <HollisVJ at pgdp.usec.com>
To: <accessD at databaseadvisors.com>
Sent: Thursday, April 22, 2004 7:02 AM
Subject: [AccessD] Prevent Duplicates


> I need a way to check if a vendor number is a duplicate entry. On the
> AfterUpdate of VenNumber I placed the below code, but it produces an error
> about not finding the Automation Object and gives the entry I made in the
> VenNumber field. VenNumber is a text field - do I have the quotes or
> parenthesis wrong?
>
> Virginia
>
> ************************
>  If Not IsNull(VenNumber) Then
>     If DCount("VenNumber", "tbl_Vendor", "VenNumber = " & [VenNumber]) > 0
> Then
>         MsgBox "You have entered a Vendor Number that already exists"
>         VenNumber.SetFocus
>         VenNumber.Undo
> End If
>     End If
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list