jazminecat
Programmer
Hey - I have this code, to enable or disable a field on my form based on what the end user selects in a combo box - if they pick an item with more than 4 digits, the field is disabled so they can't enter anything in it. Otherwise it's available for them to enter text into it.
the problem is this - because the form is a datasheet, and allows more than one record to show at a time, the thing is turning on and off with each record - if it's disabled on line 1, and enabled on line 2, that enables it again on line 1 - exactly what i need to avoid. Any thoughts?
thanks
Code:
Private Sub Combo19_AfterUpdate()
If Len(Trim(Me.Object_Code)) > 4 Then
Me.txtSubObj.Enabled = False
Else
Me.txtSubObj.Enabled = True
End If
End Sub
the problem is this - because the form is a datasheet, and allows more than one record to show at a time, the thing is turning on and off with each record - if it's disabled on line 1, and enabled on line 2, that enables it again on line 1 - exactly what i need to avoid. Any thoughts?
thanks