force update of modified date

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

What is the best way to force a date field "modified date
to be updated when a record is updated... NOT JUST
VIEWED, and closed... I have been looking at some thing
like>>
Private Sub DateModified_LostFocus()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim today As Variant <<<<<<also tried DATE
today = Date
If rst.LastModified = today Then
rst.questions.DateModified = Date
' rst.questions.upDate <<<< just a thought
Else
rst.Close
End If
End Sub

OBVIOUSLY I dont know what i am doing, PLEASE help
THANKS...
 
bob said:
What is the best way to force a date field "modified date
to be updated when a record is updated... NOT JUST
VIEWED, and closed... I have been looking at some thing
like>>
Private Sub DateModified_LostFocus()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim today As Variant <<<<<<also tried DATE
today = Date
If rst.LastModified = today Then
rst.questions.DateModified = Date
' rst.questions.upDate <<<< just a thought
Else
rst.Close
End If
End Sub

OBVIOUSLY I dont know what i am doing, PLEASE help
THANKS...

Hi Bob

You could use the before update event of the form.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me!DateModified = Date
End Sub

Regards - Joe
 
Thanks Joe, I'll give that a try in the
morning and get back to you...
"Joe Black" <[email protected]>
wrote in message

"bob"
<[email protected]>
wrote in message
What is the best way to force a date field "modified date
to be updated when a record is updated... NOT JUST
VIEWED, and closed... I have been looking at some thing
like>>
Private Sub DateModified_LostFocus()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim today As Variant <<<<<<also tried DATE
today = Date
If rst.LastModified = today Then
rst.questions.DateModified = Date
' rst.questions.upDate <<<< just a thought
Else
rst.Close
End If
End Sub

OBVIOUSLY I dont know what i am doing, PLEASE help
THANKS...

Hi Bob

You could use the before update event of
the form.

Private Sub Form_BeforeUpdate(Cancel As
Integer)
Me!DateModified = Date
End Sub

Regards - Joe
 
Thanks Joe!!
That was FAR TOO easy.... and makes more sense then the
LOSTFOCUS as that field could be avoided..
 
Back
Top