Protecting data on a form

  • Thread starter Thread starter Colin
  • Start date Start date
C

Colin

Can some one help me?
How does one avoid the possibility of changing of data
entered into a control (text box) after it has been
entered so that it can be entered once and not edited eg
a customer numbe? I only want to protect one object on
the form.
Can this property be applied to an existing form with
data in it?
 
Colin,

There are a couple of options for this, both involving
'Locking' the control in question. One option is if it is
not a new record and the other is to check to see if there
is data in the control already. Put the following in the
OnCurrent Event of the form and it will check it for every
change of records. This will check both conditions.

If Me.NewRecord = False and Len(Me!YourControlName) > 0 Then
Me!YourControlName.Locked = True
Else
Me!YourControlName.Locked = False
End If

Gary Miller
Sisters, OR
 
Gary
Thankyou for yur help

Colin
-----Original Message-----
Colin,

There are a couple of options for this, both involving
'Locking' the control in question. One option is if it is
not a new record and the other is to check to see if there
is data in the control already. Put the following in the
OnCurrent Event of the form and it will check it for every
change of records. This will check both conditions.

If Me.NewRecord = False and Len(Me!YourControlName) > 0 Then
Me!YourControlName.Locked = True
Else
Me!YourControlName.Locked = False
End If

Gary Miller
Sisters, OR





.
 
My pleasure!

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
Back
Top