After Update Property

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have a field for "CaseType". When the data is entered in
the CaseType field, I also want it to prefill in
the "PreviousCaseType" field. I need to lock
the "Previous CaseType" field but still be able to edit
the CaseType field. I tried using this code in my form
properties for

Private Sub Item_AfterUpdate()

Me!PreviousCaseType = Me!CaseType
Me!PreviousCaseType.Locked = True

End Sub
 
Is the control for the CaseType field named Item? Are you having a problem?
If so, what?

Assuming the above to be true, assigning the value of Item to
PreviousCaseType will give you the new value you just entered. You need to
use the OldValue property.

Me!PreviousCaseType = Me!CaseType.OldValue

If Item is your form name, then it appears that you typed in the Private Sub
statement yourself. Don't do this for Event Procedures, instead go to the
Properties sheet for the object, Events tab and choose [Event Procedure] in
the box for the appropriate event then press the ... button. Access will
fill in the initial information for the procedure for you.
 
Back
Top