I've been trying for 2 days straight to get Access to creat a simple 'edit' button, which changes the status of all fields in the form to .AllowEdits = true.
I read the FAQ, and used the code provided there, but it just won't work. I've set all fields to locked in the properties window, and I use this code for the 'on-click' event of my button:
Private Sub Knop2_Click()
Me.AllowAdditions = True
Me.AllowEdits = True
'if there's no subform don't include the rest of the code
For Each myControl In Controls
Select Case myControl.ControlType
Case acSubform
myControl.Form.AllowAdditions = True
myControl.Form.AllowEdits = True
End Select
Next
End Sub
Now when I open my form, the fields are nicely locked, but when I click the button, they just remain locked. What am I doing wrong?
I read the FAQ, and used the code provided there, but it just won't work. I've set all fields to locked in the properties window, and I use this code for the 'on-click' event of my button:
Private Sub Knop2_Click()
Me.AllowAdditions = True
Me.AllowEdits = True
'if there's no subform don't include the rest of the code
For Each myControl In Controls
Select Case myControl.ControlType
Case acSubform
myControl.Form.AllowAdditions = True
myControl.Form.AllowEdits = True
End Select
Next
End Sub
Now when I open my form, the fields are nicely locked, but when I click the button, they just remain locked. What am I doing wrong?