When is 'Form_BeforeUpdate' triggered?

M

mscertified

I have this code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me!UpdatedBy = fOSUserName()
End Sub

I was on the screen and paged thru a series of records, changing nothing,
yet the 'UpdatedBy' column was reset. How can I prevent this unless an actual
update occured?
 
D

Dirk Goldgar

mscertified said:
I have this code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me!UpdatedBy = fOSUserName()
End Sub

I was on the screen and paged thru a series of records, changing
nothing, yet the 'UpdatedBy' column was reset. How can I prevent this
unless an actual update occured?

That should only happen if you have some code running in some other
event -- the form's Current event, most likely -- that is dirtying each
record immediately as you move to it. The BeforeUpdate event only fires
if the form's data has been modified.
 
Top