Exporting only new records (since last export) (1 Viewer)

M

may_hem1

Guest
How is it possible to export on the records that were created since the last export?

Also, I want to export only these new records through a command button on the swichboard. How is this possible?

I thought that perhaps I could have an extra field in the table, a check box which is unticked by default, so that when an export is requested only the unticked records are exported and as each record is exported then the check box is ticked so that the next time that records is not exported.

By the way, I am using Microsoft Access 97.

Thanks in advance,

May
 

Fornatian

Dim Person
Local time
Today, 17:05
Joined
Sep 1, 2000
Messages
1,396
There are two approaches to this...

1. If you hold the date and time any records were created for you need only store the date the last successful export was made. Then use a select query to get only records after that date. Then use an update query to update when you last exported successfully

OR

2. Follow your idea of a boolean field, select only records where your field is false and then update the same recordset to make all the fields true.


Which you choose depends on whether you already have the date and time the records were created, if you do there is no additional benefit to storing the export yes/no field. If you don't store it already, then the yes/no field is viable.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:05
Joined
Feb 19, 2002
Messages
43,372
I like to use a date to control the export. The exported data needs to have a date/time field that can be used for this purpose. You also need a one-row table that holds the date/time of the last export. Use the ControlDate to select all rows with date/time > the control date. Update the control date when the export is done. The advantage this method has over a flag is that if for some reason you want to re-select a group of records, you can just modify the control date. You don't have to futz with flags.
 

Users who are viewing this thread

Top Bottom