Preventing the creation of the PasteErrors table?

  • Thread starter Thread starter Gijs Beukenoot
  • Start date Start date
G

Gijs Beukenoot

Hi all,

Having a form with a subform, the user tries to paste a bunch of
records. Some of them are valid (and end up in the table) but others
have errors (due to either an existing value or other validation
rules).

Access handles this fine however, all 'invalid' records end up in the
pasterrors table. Is there a way to prevent Access from doing this?
I've searched the options and also googled a while but no luck...

Thanks,

GB
 
In this particular case Jeff, I would like Access to ignore them, in
some other cases, I would prefer to show them the table using code (if
the user wants to view them at all).

So, what I really would like to do is to suppress the message:
errortrap it (if possible) and run some code or just suppress the
message and let some other piece of code react when the table
paste-errors suddenly exists.

I don't want the user to see the message, regardless of what Access
does with the records...

GB


From Jeff Boyce :
 
Ah, you don't want the messages seen by the user.

Another approach, then, would be to turn off the warnings while that
particular append is happening, then turn them back on afterwards.

If you are comfortable in VBA, you can do this with the:
DoCmd.SetWarnings
command surrounding the running of the query/SQL.

If you'd rather use a macro, you can also turn the warnings off first, run
the query, then turn the warnings back on.

WARNING! Turn the warnings back on, no matter what! If you don't, you
won't know when Access is doing something wrong.
 
Hmm, that simple... <sigh>

Thanks Jeff, I'll try this out.

(the users is copying/pasting from Excel in this case instead of
running a query but I suppose the result will be the same)



From Jeff Boyce :
 
Back
Top