Flag field when record changed

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
 
R

Ronald W. Roberts

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
 
M

Marshall Barton

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).
 
R

Ray

Thanks! Marshall's suggestion worked great... after I finally figured out
how.

Raphael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top