Confirming save of duplicate records

  • Thread starter Thread starter helenp
  • Start date Start date
H

helenp

I have a db where clients' medical appointments are
recorded. When appointments are entered, if the
combination of values in three fields
(clientid/date/provider) already exists, I'd like to
require a confirmation from the user before saving the
record. I don't want to exclude duplicates entirely,
because sometimes they're legitimate. How can I do this?

Thanks!
Helen
 
In the Before Update, do a domain funciton such as DCount to see if the
values exist.
ie
if DCOUNT("*", "MyTable", "ClientID = " & me!ClientID & " AND date = " &
Me!DateField . . . . ) > 0 then
'Put up the message box
'If they select Yes, allow the save
'If they select no set Cancel = True
End iF
 
Back
Top