DateTimeStamp

T

Tom

I use a continuous form in which I want to track most recent changes.

Here's what I have:

Table:
- Bunch of fields
- Date field ("DateTimeStamp"; Format = General Date)

Query:
- Bunch of fields
- DateTimeStamp field
- Expression: "LastUpdate:
IIf([DateTimeStamp]=DMax("[DateTimeStamp]","tbl01PrioritizationData"),"True","False")"

Form (Continuous form):
- Bunch of fields
- DateTimeStamp

Events:
- BeforeUpdate event... listed below

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.DateTimeStamp = Now()
Me.Requery
End Sub


Procedure:
1. In the form, I change any of the fields.
2. BeforeUpdate event kicks in and puts current date-time-stamp into
DateTimeStamp field

Expected result (this is where I need some help with):
- After I made a change in any of the records, conditional formatting for
all "bunch of fields" should kick in based on following expression:
- [LastUpdate]="True"
- This should turn all fields (basically entire row/record) into "green
color"

Problem at this time:
1. W/o closing/reopen the form, it wouldn't see the record highlighted
(green) where the latest change occurred
2. So, I put the "Me.Requery" into the BeforeUpdate event.
3. However, at this time, I get the following error:

"Run-Time Error '2115'.
The macro or function set to the BeforeUpdate or ValidationRule property for
this field is preventing Budget Management from saving the data in the
field."

I tried to put the "Me.Requery" into a 2nd event (AfterUpdate). This,
however, gives me the following error:

"The expression Before Update you entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.


Again, the idea is to make a change in any field, see the DateTimeStamp
updated, and then -- most importantly -- see the record that was changed
turn "green" (background color).

Please help!

Tom
 
Top