I have a main form with several tab controls with subforms in them. On the first tab or subform I have a "checkbox 1", which shall be:
- checked if "textbox 1" is not empty
- unchecked if "textbox 1" is empty
The code is directly put into the Class Object of "subform 1", that's why I thought I could use Me.
Here is my code, but I always get error messages :(
Private Sub Ctltextbox_1_AfterUpdate()
If Len(Ctltextbox_1.Value) = 0 Then
Me.checkbox_1.Value = 0
Else
Me.checkbox_1.Value = -1
End If
End Sub
That way I am getting the
Run-time error '2448': You can't assign a value to this object.
On the line that attempts to assign -1 to Me.checkbox_1.Value.
-1literal isn't valid. Is there avbCheckedconstant in scope? Have you triedTrueinstead? - Mathieu Guindon