After Update Property

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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top