Undo edit on Subform

stretch66

Racing towards the start
Local time
Today, 23:49
Joined
Sep 28, 2005
Messages
72
Hi,
Have a main form with subform. Can udo edits on the main form and am trying to do the same for the subform and am having problems. Can someone correct my syntax for me please..........and maybe someday I'll get it!

Here's my code below....thanx.

Private Sub PDEditUndoBut_Click()
On Error GoTo Err_PDEditUndoBut_Click

'Me.Label95.Visible = False
'Me.Label62.Visible = True
Beep
Me.Undo
Me.fmEmergency_Sub.Form.Undo


Exit_PDEditUndoBut_Click:
Exit Sub

Err_PDEditUndoBut_Click:
MsgBox Err.Number, Err.Description
Resume Exit_PDEditUndoBut_Click

End Sub
 
Are you aware that moving the focus to a SubForm saves the MainForm record changes and moving the focus back to the MainForm from the SubForm saves the SubForm changes? Once the changes are saved to the table then UnDo no longer works. Your syntax looks good other than there is nothing to UnDo on the SubForm.
 
RuralGuy said:
Are you aware that moving the focus to a SubForm saves the MainForm record changes and moving the focus back to the MainForm from the SubForm saves the SubForm changes? Once the changes are saved to the table then UnDo no longer works. Your syntax looks good other than there is nothing to UnDo on the SubForm.

Thanks Ru! I didn't know that. Decided to take the subform off in the end and put controls in it's place as was sure the user's would think they had undone something and they hadn't. maybe when I get better at this I can come up with a different solution.
 

Users who are viewing this thread

Back
Top Bottom