form undo actions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

As I understand it, MS Access uses a mechanism when the user loses focus
from main to subform. After that point you cannot use the Undo method to
clear the form.

I would like to make a procedure to handle both cases:

Ie;

If (undo is not allowed )Then
'Do this
Else
me.undo
End IF

Can somebody help me with this?

Cheers,
David
 
Not clear on what you mean. Moving between main forms and subforms
(and vice versa) causes the record losing focus to be saved. You can't
stop that happening. If you want to be able to undo the whole thing
you might consider using temporary tables for storing the data
displayed and then updating the main tables explicitly if you decide to
keep the whole record.
 
Hi sorry, i did not finish my sentence.

Yes, we are saying the same thing.

What I propose to do is have a clear button on my form.

If the form cannot be undone, then I would like to delete this record.

I do not know a method to test if the Undo method will not work

If (undo is not allowed )Then
' Delete this record
Else
me.undo
End IF

Hope this is clearer,
David
 
As far as I understand it - the undo method will always work - it's
just a matter of what, if anything, it will undo. Best thing (IMHO) is
to test something else such as whether or not you actually want to save
the record - if not then perhaps run an delete query that will delete
the main record and the subrecords (in related tables).
 
Back
Top