Flag field when record changed

  • Thread starter Thread starter Ray
  • Start date Start date
R

Ray

I update any one of 2000 records through a form in Access. This data is
exported regularly and uploaded. To minimize the upload data I want to
upload only the records that have changed.

My thought is to flag an extra field in the table when any change or
addition is made to a record or a new record is added.

Is there a way to do this?

THANKS!!

Raphael
 
Ray said:
I update any one of 2000 records through a form in Access. This data is
exported regularly and uploaded. To minimize the upload data I want to
upload only the records that have changed.

My thought is to flag an extra field in the table when any change or
addition is made to a record or a new record is added.

Is there a way to do this?

THANKS!!

Raphael
In the BeforeUpdate event or the OnCurrent event at the form level test
to see
if the current record is dirty. Flag can be a hidden yes/no control on
the form
bound to a field in your table.

If Me.Dirty Then
Me!Flag=True
Else
Me!Flag=False
End If
 
Ray said:
I update any one of 2000 records through a form in Access. This data is
exported regularly and uploaded. To minimize the upload data I want to
upload only the records that have changed.

My thought is to flag an extra field in the table when any change or
addition is made to a record or a new record is added.


I prefer to do this kind of thing by using a LastChanged
date field instead of a simple flag field. You can use the
Form's BeforeUpdate event to set the (invisible?)
LastChanged control to Now(). This way you can easily
filter the upload using this field without worrying about
clearing all the flags (especially if the upload fails and
you have to retransmit the records).
 
Back
Top