J
jasenpeters
XPPro SP2, Access 2003
I would like to call a custom function on the 'before Insert/Update'
events of a form.
I've tried the following procedure call in the event code...
LogDate "Insert", Me.Recordset
The procedure definition is....
Public Sub LogDate( strEvent as string, rs as DAO.Recordset)
With rs
If strActivity = "Insert" Then
.Edit
![InsertDate] = Now()
.Update
ElseIf strActivity = "Update" Then
.Edit
![UpdateDate] = Now()
.Update
End If
End With
End sub
However, the form does not reflect the changes. Is there something
missing in the code?
I'm sure it has to do with being on the "current" record. I assume that
when the recordset is passed to the procedure that it is still pointing
at the "new" record?
Ultimately, I would like to add Date and other information to the
current/new record by using a procedure call.
TIA
Jasen
I would like to call a custom function on the 'before Insert/Update'
events of a form.
I've tried the following procedure call in the event code...
LogDate "Insert", Me.Recordset
The procedure definition is....
Public Sub LogDate( strEvent as string, rs as DAO.Recordset)
With rs
If strActivity = "Insert" Then
.Edit
![InsertDate] = Now()
.Update
ElseIf strActivity = "Update" Then
.Edit
![UpdateDate] = Now()
.Update
End If
End With
End sub
However, the form does not reflect the changes. Is there something
missing in the code?
I'm sure it has to do with being on the "current" record. I assume that
when the recordset is passed to the procedure that it is still pointing
at the "new" record?
Ultimately, I would like to add Date and other information to the
current/new record by using a procedure call.
TIA
Jasen