I am having some problems with my MDI program. I am not sure how to code my undo menu item. So far I have:

if typeof activeform = "Transaction" then
transaction.datprimaryrs.recordset.cancelupdate
end if

datprimaryrs is the name of my data control on the transaction form.

This results in the program opening a new window of the transaction form and correcting the problem. But the problem is now there are two windows instead of one. So I tried

ActiveForm.datprimaryrs.recordset.cancelupdate

This doesn't give me any errors, but it doesn't appear to do anything. The undo doesn't work.

I even tried created a public sub procedure that is on the transaction form to undo the code. But this doesn't work either. Nor does passing the transaction form to that procedure.

What am I doing wrong?