G
Guest
I'm trying to create forms for adding data to tables, trouble is when you
close the form, if there is anything in the text boxes it tries to update the
table. I don't want closing the form to run an update, it would be useful if
it asked first maybe, but not without confirmation but can't see how to stop
it. I have tried adding a button to update, and another to close, but even my
own close button is trying to update the table. I have also tried using code
(below) as posted by someone else prior to an update to confirm whether or
not data should be saved, but the form still then goes on to try to save even
if you say no.
If MsgBox("Do you want to save the changes?", vbYesNo,"Confirm Change")
= vbNo Then
Cancel = True
Me.Undo
End If
close the form, if there is anything in the text boxes it tries to update the
table. I don't want closing the form to run an update, it would be useful if
it asked first maybe, but not without confirmation but can't see how to stop
it. I have tried adding a button to update, and another to close, but even my
own close button is trying to update the table. I have also tried using code
(below) as posted by someone else prior to an update to confirm whether or
not data should be saved, but the form still then goes on to try to save even
if you say no.
If MsgBox("Do you want to save the changes?", vbYesNo,"Confirm Change")
= vbNo Then
Cancel = True
Me.Undo
End If