View Single Post
  #8  
Old April 22nd, 2010, 08:41 AM posted to microsoft.public.sqlserver.programming,microsoft.public.access.forms
Arvi Laanemets
external usenet poster
 
Posts: 397
Default Overriding constraint violation message

Thanks!

It was what I was searching for! (Almost.)

The function works fine when I'm adding or editing a record. Unfortunatelly
it looks like MS has forgotten the case, when records are deleted - so
probably I have to find the solution myself. I haven't worked much with
recordsets per VBA, so there is a lot of reading to be done.

It looks like form's Delete event will be a right place to call a function
which will delete ODBC records. And probably I'll write a separate function
to be called from Delete event

Maybe I can get some hints:
1) how to get information, which records were marked for deletion on form
(as all my forms are continous, unlike adding/editing the record, the user
can delete several records at once)?;
2) when some records marked for deletion pass the check, and some not, is it
better to rollback the whole operation? Or is it better to handle every
marked record separately?


Arvi Laanemets


"Stefan Hoffmann" kirjutas sõnumis news:
...
hi Arvi,

On 21.04.2010 15:53, Arvi Laanemets wrote:
This link refers to almost same solution I found myself. But
DBEngine.Errors doesn't work for me. There exists only one item
DBEngine.Errors(0) with Number=3001 - "Invalid argument". And it doesn't
depend on my actions which caused the error (i.e. deleting linked data
or entering some duplicate value).

Ah, I see, take a look at

http://support.microsoft.com/default...b;en-us;206175

mfG
-- stefan --