After form Update event

C

Cydney

I have a form that I would like to have update the field called
"PESA_timestamp" if any other field on the form is updated. (Code shown
below.)

It does the update just fine, but it won't let me move to the next record.
It stays in Edit mode until I hit the Escape key.

Also, how do I get the actual login name rather than the PC's user name?

Private Sub Form_AfterUpdate()
Me.PESA_timestamp = CurrentUser() & " ~ " & Date
End Sub
--
Thank you, cs
~~~~~~~~~~~~~~~~~~~~~~~~
"What lies behind us and what lies before us are tiny matters compared to
what lies within us."
~ Ralph Waldo Emerson
 
M

Marshall Barton

Cydney said:
I have a form that I would like to have update the field called
"PESA_timestamp" if any other field on the form is updated. (Code shown
below.)

It does the update just fine, but it won't let me move to the next record.
It stays in Edit mode until I hit the Escape key.

Also, how do I get the actual login name rather than the PC's user name?

Private Sub Form_AfterUpdate()
Me.PESA_timestamp = CurrentUser() & " ~ " & Date
End Sub


If you think about for a while, it makes no sense to modify
a record immediately after the record was saved. The change
to the just saved record would then have to be saved (again)
and the AfterUpdate code would change it again and round and
round you go.

Use the form's BeforeUpdate event instead.
 

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