Do not insert record if user does not submit

brian7268

Registered User.
Local time
Today, 13:40
Joined
Mar 19, 2013
Messages
20
I am working on a form and I only want the information to be inserted into the database if the user clicks the button at the bottom. In other words, if the user is filling out the form and then closes the form, I do not want that record saved. I would have thought this would be an easy thing to accomplish, but can't find any solutions.

Thanks for the help!
 
either use an unbound form, but this can be hard work

even easier - use a temporary table with the same structure as the real table. work with the temp table. if you do not accept the entry, do nothing - if you do, then a simple append query will add the record in the temp table, to the real table
 
Thanks for the reply! As luck would have it, I found exactly what I was looking for shortly after posting. I figured I would share.

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
 If MsgBox("Do you want to save this Bypass Report?", vbQuestion + vbYesNo) = vbNo Then
        Cancel = True
        Me.Undo
    End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom