Hello everyone and thank you for your time,
I have a simple form with a subform with a CANCEL button on it. The problem is that if I don't use the DoCmd.Requery command, the form advances to the next record even though the previous one was still empty. If I put the DoCmd.Requery on the bottom or the top of the Cancel code it dose not work, the ONLY way I have my form working properly at the moment is like so....
Private Sub Cancel_Click()
Me.TimerInterval = 500
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End Sub
Private Sub Form_Timer()
DoCmd.Requery
End Sub
This has solved my problem and everything is ok, it's just that I'm not feeling comfortable using Timer event and would appreciate if someone could tell me what my problem is and how to put that requery command on the cancel button.
Thanking you all in advance.
Mohammad.
I have a simple form with a subform with a CANCEL button on it. The problem is that if I don't use the DoCmd.Requery command, the form advances to the next record even though the previous one was still empty. If I put the DoCmd.Requery on the bottom or the top of the Cancel code it dose not work, the ONLY way I have my form working properly at the moment is like so....
Private Sub Cancel_Click()
Me.TimerInterval = 500
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End Sub
Private Sub Form_Timer()
DoCmd.Requery
End Sub
This has solved my problem and everything is ok, it's just that I'm not feeling comfortable using Timer event and would appreciate if someone could tell me what my problem is and how to put that requery command on the cancel button.
Thanking you all in advance.
Mohammad.