no duplicates on close of form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that the users will inputdata in the form view and the
datasheet view.
They need the ability to copy and paste a number of lines at a time. I have
one
field that I do not want duplicated. I can run a query checking for
duplicates, but I do not know where to locate this so they can paste a number
of items in data sheet view, but cannot close the form until all ducplicates
are resolved?
 
Cynthia

Take a look at the BeforeUpdate event for the Form. This gives you a place
to validate (including checking for duplicates) and, if necessary, cancel
the update.

Good luck

Jeff Boyce
<Access MVP>
 
If I put the code here won't I get an error if I am trying to copy multiple
items
in datasheet view? I want to be able to add 15 or so items, then change them
so they are not duplicates. I only want the code to run before they close
the
form.
 
Cynthia

Each control also had a BeforeUpdate event.

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top