Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable/disable in datasheet view?

Status
Not open for further replies.

jazminecat

Programmer
Jun 2, 2003
289
US
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.

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
 
I think Conditional Formatting with an Expression should suit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top