Access 2010, Save info to varaible just before new record has been written

Hi

I am using access 2010

I would like to record the value of a data field just before a NEW record has been saved.
I tried the code below, but....


public strLastDataEntry

Private Sub Form_AfterUpdate()
     If Me.NewRecord = True Then
             strLastDataEntry = [myfield]
     End if
End sub
peispudAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
Move your code to the Before Update event. By the time you hit AfterUpdate, Me.NewRecord would not be True.
0
 
peispudAuthor Commented:
Perfect and timely.  Thank you.
0
All Courses

From novice to tech pro — start learning today.