I have got a form to change information on a table. There is a button to unlock all text boxes and another button to save the changes. When I click the save button I want it to show a vbYesNoCancel message box, then, if no is clicked, me.undo and lock all text boxes, if yes is clicked, save and lock all text boxes. With the code I'm using it doesn't save the changes when I click yes.
Can anyone help?
Can anyone help?
Code:
Private Sub Command55_Click()
MsgBox "Do you want to save the changes?", vbYesNoCancel, "Confirm Save"
If vbNo Then
Me.Undo
End If
If vbYes Then
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then
ctrl.Locked = True
End If
Next
End If
Me.Command56.Enabled = False
Combo44.SetFocus
End Sub