So,
I have a form that takes in an input from the user and a code on the back end to test whether or not they click a button to confirm that the change has been made. This way, they can't just type in a new value and it changes automatically without them confirming with a button click and msg box.
The code is as follows:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
DoCmd.SetWarnings False
If Not blnSave Then
Cancel = True
Me.Undo
End If
DoCmd.SetWarnings True
End Sub
Then, I have another Sub
Code:
Private Sub UpdateValue_Click()
blnSave = MsgBox("Are you sure you want to save this record?", vbQuestion + vbYesNo, "Save Confirmation")
End Sub
I need to make it so that if the person clicks "YES" that another series of things happen. I tried,
Code:
Private Sub UpdateValue_Click()
blnSave = MsgBox("Are you sure you want to save this record?", vbQuestion + vbYesNo, "Save Confirmation")
If blnSave = vbYes Then
whatever
End If
End Sub
But this dosen't work. Any advice?