cancel subform entry from parent form

M

mick

I'm trying to create a command button called "cancel" on
my parent form that will test the subform for "dirty" and
will undo unwanted changes to the data before it is
updated. But, when the button is clicked , the subform
loses focus and is updated and is no longer dirty. How
can I get around this?
 
H

HSalim

That is a complicated question.
Remember, for the subform each record is a new form sorta
i.e if you update recordq and move to record 2, record1 is committed and
the form is no longer dirty.

So, How do you get around that problem?
On the main form's current event, copy the recordset of the subform into
another recordset or temp table.
If the user clicks the cancel button,
update all the subform records from the recordset and delete any new lines

HS
 

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