I have a project I'm working on where I want to disable editing on a form in certain circumstances. To avoid confusing the operator, I would like to change the appearance of the form so that is visually different between the two modes. A sort of visual clue if you like.
I developed the following code, but I find that this won't compile (to my surprise) :
The error message is "Method or data member not found" and the .BackStyle on line #7 is highlighted (yellow).
Does anyone have any explanation? I have checked various of the controls (TextBox; Label; ComboBox; CheckBox) and only CheckBox doesn't have this property.
I developed the following code, but I find that this won't compile (to my surprise) :
Code:
Private Sub chkLocked_AfterUpdate()
Dim ctl As Object 'Same problem if done As Control
With Me
.AllowEdits = (Not .chkLocked)
For Each ctl In .Detail.Controls
.BackStyle = .chkLocked
Next ctl
End With
End Sub
Does anyone have any explanation? I have checked various of the controls (TextBox; Label; ComboBox; CheckBox) and only CheckBox doesn't have this property.
Comment