Rollback not working

  • Thread starter Thread starter RogB
  • Start date Start date
R

RogB

Guest
Rollback not working (Resolved)

I am developing an order system in Access 97.

The system requires users to enter data in a succession of forms each linked to their own table but updating some main tables when a "Next" button is clicked.

I want to use transaction processing so there is no chance of partial orders being left in the main tables if the user exits mid order of the system crashes (admittedly unlikely but !).

I have created a workspace (wsp) and use the statement "wsp.begintrans" before the first update occurs.

I'm using "wsp.committrans" after all the updates have been done, immediately before the final form is opened.

On each form there is a "Cancel" button which activates a "wsp.rollback" command.

The transaction processing works if the application is closed mid order but for some reason the rollback commands don't do anything when a cancel button is clicked on one of the forms.

There are no error messages and in debug view execution passes through the statement in the normal way.

I am a bit stumped by this and am wondering if anyone has any suggestion as to why it's not working?

Thanks

Roger
 
Last edited:
Unfortunately, I have never used this technique but I can offer a suggestion. A while ago, I changed how I add things like this. If I am going to allow the user the ability to cancel the transaction before finishing I use an unbound form. The user enters the information into blank textboxes. When they click "submit" the code does all the validation necessary, opens a recordset and adds the record.
 
Thanks Chenn,

I had my wires crossed on this one.

I was trying to use transaction processing across an entire project.

I don't think it is meant to be used like that. I did some experimenting and it worked fine within a single proceedure of a single module.

I think I've decided to give each form its own table. This will alow users to go back and change things. When they are happy the lot will be submitted to the main table.

Roger
 

Users who are viewing this thread

Back
Top Bottom