Hi
Is there a way of preventing entering duplicate data when using forms? i.e. I am entering Venue name which 99% of the time should be unique, other data is address, toen, county, region and postcode
Thanks
Dave
Hi
Is there a way of preventing entering duplicate data when using forms? i.e. I am entering Venue name which 99% of the time should be unique, other data is address, toen, county, region and postcode
Thanks
Dave
IMHO form validation is best done in either the forms Before Update event or the Before Update event of individual controls. These events can be cancelled if a duplicate is found.
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
What exactly is/are the table(s) behind the Form? Do you have a Primary key? Do you have a unique composite index on the fields you "might" duplicate?
Do you have any error handling code in form events?
You might want a Lookup table(s) for Town, County, Region and Postal Codes.
As Bob said the BeforeUpdate event (form or control) is "best" place for validation.
You might check for Dcount(some unique value) > 0 then "duplicate"....
Good luck.