Stopping Duplicate Value Entries

malsla

New member
Local time
Today, 11:07
Joined
Oct 17, 2006
Messages
4
I have a booking form database
With a date field.
I want users to be warned when they try to enter a date that already exists in the database in order to avoid double booking:confused: .....

all suggestions appreciated:)
 
In the table, DATE field put INDEX with UNIQUE = yes.
 
thanks for that...but that only pops up with an alert once the entire record is complete, and then its just an Microsoft Office Error pop-up which the average user wouldn't understand....is it possible for an alert to popup once that field has been completed with a customised message?
 
Look at "DemoDateUniqueA2000.mdb",
open Form1 and try to add a new rec with
the same date.
 

Attachments

stopping duplicate value

write

me.refresh

on the lost_focus event of the primary key field. when you attempt to leave the primary key field after entering the duplicate value it will alert you. Add an error trap routine to the event procedure as well to come out of the error nicely.

apr pillai
 

Users who are viewing this thread

Back
Top Bottom