form field allow edit = false

B

balu

dears,
how to make an (field control ) on a form bound control to non editable
after update?
please advise
 
L

Linq Adams via AccessMonster.com

Private Sub Form_Current()
If Me.IsNull(TextboxControl) Then
TextboxControl.Locked = False
Else
TextboxControl.Locked = True
End If
End Sub

But keep in mind that you need to have a strategy in place in case incorrect
data is entered. A supervisor or administrator type has to have access to a
different form where this can be edited, or direct access to the underlying
table to do the same. Another thing I've done is to use the OnClick event of
a label to Unlock the field temporarily, with only the supervisor or
administrator type knowing of its existence. Most users don't even realize
that labels can be clicked.
 
Top