thunderchicken
MIS
Hi,
I've been attempting to set up a user and timestamp on a table to document changes to data. To make this work, I've attempted to create an event trigger tied to a subform, (to maintain data on the DRAW_REV table), to update the user id and the date updated when the NOTE field is updated:
Private Sub NOTE_BeforeUpdate(Cancel As Integer)
UID = CurrentUser()
DATEUP = Now()
End Sub
The user id is updated fine, but the date updated remains unchanged by the routine.
Related to this:
I added the =Now() as a default value on the DRAW_REV.DATEUP field, and this works fine when a new record is added. The data is displayed properly by the subform, but just not updated.
I tried setting the default value for the UID field, on the table, to be =CurrentUser(), but get an error when I try to save the table design:
Unknown function 'CurrentUser' in validation expression or default value on 'DRAW_REV.UID'.
If I set the subform up to assign the default values when a new row is added, they both work fine. Go figure!
Can anyone tell me why some of these functions only work some of the time, and how I can get the event trigger to work?
I appreciate any insights you can provide.
Dave
I've been attempting to set up a user and timestamp on a table to document changes to data. To make this work, I've attempted to create an event trigger tied to a subform, (to maintain data on the DRAW_REV table), to update the user id and the date updated when the NOTE field is updated:
Private Sub NOTE_BeforeUpdate(Cancel As Integer)
UID = CurrentUser()
DATEUP = Now()
End Sub
The user id is updated fine, but the date updated remains unchanged by the routine.
Related to this:
I added the =Now() as a default value on the DRAW_REV.DATEUP field, and this works fine when a new record is added. The data is displayed properly by the subform, but just not updated.
I tried setting the default value for the UID field, on the table, to be =CurrentUser(), but get an error when I try to save the table design:
Unknown function 'CurrentUser' in validation expression or default value on 'DRAW_REV.UID'.
If I set the subform up to assign the default values when a new row is added, they both work fine. Go figure!
Can anyone tell me why some of these functions only work some of the time, and how I can get the event trigger to work?
I appreciate any insights you can provide.
Dave