When is 'Form_BeforeUpdate' triggered?

G

Guest

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.
 

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

Top