A Real Puzzle [UpdateOn]

S

Steve

I am developing an application for a group of user's, and
there is a requirement that a field be included in every
table, that is able to record exactly when each record is
updated or created (New Record)- this field might be
called [UpdatedOn] for example. Question, how am I able
to acheive this goal and the answer must be able to be
used in several forms in the same database. I have tried
using - Me.UpdatedOn = Now() - but this only seems to
work on one form in database, does anybody know of a way
to modify the event procedure to reference other forms in
the same database ie Forms!frmPrimarySubForm[UpdatedOn =
Now() or something similar. Thank you all for your time
and effort. I now tried:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
Me.Timestamp = Format(CurrentUser, ">") & " " & Date
& " " & Time
End If
End Sub
 
B

Byron

Steve,

Try placing Now() in the default value of the field or
the control on your form(s).

HTH

Byron
 
R

Rick

You got several responses in your previous post from 1:44 today. Please do
not repeatedly post the same questions.



I am developing an application for a group of user's, and
there is a requirement that a field be included in every
table, that is able to record exactly when each record is
updated or created (New Record)- this field might be
called [UpdatedOn] for example. Question, how am I able
to acheive this goal and the answer must be able to be
used in several forms in the same database. I have tried
using - Me.UpdatedOn = Now() - but this only seems to
work on one form in database, does anybody know of a way
to modify the event procedure to reference other forms in
the same database ie Forms!frmPrimarySubForm[UpdatedOn =
Now() or something similar. Thank you all for your time
and effort. I now tried:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
Me.Timestamp = Format(CurrentUser, ">") & " " & Date
& " " & Time
End If
End Sub
 
J

John Vinson

does anybody know of a way
to modify the event procedure to reference other forms in
the same database ie Forms!frmPrimarySubForm[UpdatedOn =
Now() or something similar. Thank you all for your time
and effort. I now tried:

Stop.

You're apparently assuming that the users are updating data stored in
a Form.

THEY ARE NOT. They're updating data stored IN A TABLE, using the Form
as a tool.

You'll need to have code in all of the Forms which might update the
table to stash Now() into the timestamp field *in the table* (not on
some other form).
 

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