RollBack DoCmd

KAN

New member
Local time
Today, 02:41
Joined
Jul 28, 2003
Messages
6
I am trying to input several new records into 3 tables. I don't want to send the first two through without the last one succeeding. I am using the DoCmd.RunSQL method with my Insert Into SQL statement following the command. I have also set up a workspace object with the begintrans at the beginning of the procedure. This is all being done in a VB Access Module. I also have a on err statement set uo to rollback the transaction in the event of an error. The only time I succeeded in seeing my error message was when I had the warnings and Confirm setting set to On. As far as I can tell, I am doing things correct.

Thanks in Advance

K
 
I think your method of doing should work, but I think I might go at this issue in a different way. It sounds to me like you are concerned that the inserted data will fail because of a key violation. I would first check all of the inserts for key violations in the code and if it failed provide a good error message to the user. If it passed the key violation tests, then you could just process then appends and not be concerned with the process failing so you could use currentdb.execute instead of the Do Command.
 

Users who are viewing this thread

Back
Top Bottom