View Single Post
  #2  
Old June 11th, 2005, 01:28 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Perhaps use the GotFocus event (or the form's Current event) to test the
value that is in the textbox and see if it matches the default value, and
lock the data if it doesn't.

Private Sub ControlName_GotFocus()
Me.ControlName.Locked = Not (Me.ControlName.Value = _
Me.ControlName.DefaultValue)
End Sub

--

Ken Snell
MS ACCESS MVP

"Robert_L_Ross" wrote in message
...
Ok, here's the deal:

I have a field on my form that defaults to today's date (called RecdDate).
The user has a chance to change that field when the form is first opened,
as
it is the default first field the form tabs to.

I want the user to be able to change the default date to a new date, but
after the record is saved the first time, I don't want the user to change
that field. See, the field generates a Julian Date. I combine the Julian
Date along with a Batch Number to create a BatchID - a key that can never
change.

If I allow the user to change the RecdDate, it would change the Julian
Date,
which would change the BatchID and create orphan records.

How can I use the Before Update property of the field to allow me to store
or change the first time the record is opened, but never allow it if the
record has been saved?