Cancelling record

J

John

Hi

How can I cancel a new record in a second from form this form where user has
enter some text in a field but has not saved? I have tried using
from!form2.undo but that does not work.

Thanks

Regards
 
S

Stefan Hoffmann

hi John,
How can I cancel a new record in a second from form this form where user has
enter some text in a field but has not saved? I have tried using
from!form2.undo but that does not work.
When the focus is set to your second form, the record is saved
automatically. You can't undo it then anymore.

You may implement a logic like that:


Private SaveRecord As Boolean

Private Sub Form_Current()

SaveRecord = False

End Sub

Private Sub cmdSave()

SaveRecord = True

End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer)

Cancel = Not SaveRecord

End Sub


mfG
--> stefan <--
 

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

Similar Threads


Top