A Real Puzzle [UpdateOn]

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
Steve,

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

HTH

Byron
 
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
 
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).
 
Back
Top