Filledvoid
New member
- Local time
- Today, 09:09
- Joined
- Apr 14, 2016
- Messages
- 3
Hello all,
I have a Microsoft Access 2010 database that uses a form that saves data related to a purchase (new records). Is there a way to prevent the accidental Tabbing out of the form and Saving the record . Ive been experimenting with the Before Update Section to either give me the ability to save changes, exit the form or cancel the update and stay in the form without losing data. But despite of what I enter the form seems to be losing the data I have typed in when choosing 'Cancel'
Would it be possible to change / add lines of code to this so that the above is accomplished.
I have a Microsoft Access 2010 database that uses a form that saves data related to a purchase (new records). Is there a way to prevent the accidental Tabbing out of the form and Saving the record . Ive been experimenting with the Before Update Section to either give me the ability to save changes, exit the form or cancel the update and stay in the form without losing data. But despite of what I enter the form seems to be losing the data I have typed in when choosing 'Cancel'
Would it be possible to change / add lines of code to this so that the above is accomplished.
Code:
Dim strMsg As String
Dim iResponse As Integer
strMsg = "Do you wish to save the changes?" & Chr(10)
strMsg = strMsg & "Click Yes to Save or No to Discard changes."
iResponse = MsgBox(strMsg, vbQuestion + vbYesNoCancel, "Save Record?")
If iResponse = vbNo Then
ElseIf iResponse = vbCancel Then
End If