I have a section of code that prompts a user to see if they wish to save the Comments they have just made. If they say Yes then save, if they say no then dont.
The code below as far as I am aware should do this but when you say no the comments is still saved in the table. Any ideas why?
Dim Result As Integer
Result = MsgBox("Do you wish to Save?", vbYesNo, "Save?"
If Result = vbYes Then
[chkActive] = True
[datStamp].Enabled = True
[datStamp] = Now()
DoCmd.Close acForm, "frmItemComments", acSaveYes
Else
DoCmd.Close acForm, "frmItemComments", acSaveNo
End If
The code below as far as I am aware should do this but when you say no the comments is still saved in the table. Any ideas why?
Dim Result As Integer
Result = MsgBox("Do you wish to Save?", vbYesNo, "Save?"
If Result = vbYes Then
[chkActive] = True
[datStamp].Enabled = True
[datStamp] = Now()
DoCmd.Close acForm, "frmItemComments", acSaveYes
Else
DoCmd.Close acForm, "frmItemComments", acSaveNo
End If