Undo command

B

Bumbino

I have a form with an embedded subform. On the main form I have a cancel
button that performs the Me.Undo action and I would like it to also Undo the
entries in the subform but I cannot get it to work. Any ideas?
 
J

Jeanette Cunningham

If your subform is in continuous or data sheet view, each time the user
moves to a different row or record, the edits, or the new record, are saved
and undo is not available for the previous record.

When a user moves off the subform to click a button on the main form, the
record in the subform is saved, so undo is not available for the previous
record on the subform.

You could allow a user to delete a record in the subform using a button on
the main form, however it is easier to code if the delete button is on the
subform.

Jeanette Cunningham
 
B

Bumbino

Thanks Jeanette, that helps.

Jeanette Cunningham said:
If your subform is in continuous or data sheet view, each time the user
moves to a different row or record, the edits, or the new record, are saved
and undo is not available for the previous record.

When a user moves off the subform to click a button on the main form, the
record in the subform is saved, so undo is not available for the previous
record on the subform.

You could allow a user to delete a record in the subform using a button on
the main form, however it is easier to code if the delete button is on the
subform.

Jeanette Cunningham
 
G

Graham R Seach

The ONLY way to do this is to create a new workspace/connection (depending
on whether you're using dao/ado) in the main form, and manage the subform's
transactions from there.

For example, if you're using DAO, you would need to create a new Workspace
object and Recordset object in the main form. Then set the subform's
recordset = the new recordset. Then start a nw transaction in the Workspace
object, and control it from the main form.

I've done it before, but I can't recall whether I did it in DAO or ADO. In
any case, I don't have the code with me right now. Do you feel capable of
investigating this yourself?

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top