I have a form with a button, the button should toggle editing of the form, by default the form is set to allowedits No, when I click the button it works, I can edit. When I click the button again, I can still edit where did I go wrong?
// I added a message box to see the value of allow edits. It seems to be toggling between true and false, but I can always edit after pressing the button!
Code:
Private Sub BtnEditStock_Click()
Me.AllowEdits = Not Me.AllowEdits
Dim myvar As Boolean
Dim ans
myvar = Me.AllowEdits
ans = MsgBox(myvar, vbOKOnly)
End Sub