Requery ONLY works in timer 0.5 sec later !!!

6

6655326

Requery ONLY works in timer 0.5 sec later !!!


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.
 

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