By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,516 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,516 IT Pros & Developers. It's quick & easy.

undo in a subform.

P: 44
i wrote in the cancel command button code
me.undo
if i made changes in the main form not in the subform , if i click cancel then its working fine.
But if made changes in the subform also, then cancel is not working.
i wrote forms!subformname.undo also.
its not working
please help me
thanks in advance
May 11 '07 #1
Share this Question
Share on Google+
2 Replies


JConsulting
Expert 100+
P: 603
i wrote in the cancel command button code
me.undo
if i made changes in the main form not in the subform , if i click cancel then its working fine.
But if made changes in the subform also, then cancel is not working.
i wrote forms!subformname.undo also.
its not working
please help me
thanks in advance
Reason.

When you're in the main form...you enter a value. Then move to the subform, as soon as your cursor hits the first field, your main form's record is committed. There is no undo after that. Same goes for your subform..once the focus leaves the subform, the record is committed. In these cases, you must first delete the record.

If you have referental integrity set in your table relationships and cascading delete option set to yes...then you can get away with deleting the main form's record, and it will delete the subform records too.

Otherwise, you must delete the subform records first, then the main form's record.

J
May 12 '07 #2

P: 1
If your undo button is on the main form, please try this.

Screen.PreviousControl.SetFocus
Screen.ActiveControl.SetFocus
Me.Application.RunCommand acCmdUndo

My Access Ver.2007
Dec 7 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.