Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting only new records (since last export)

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
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
 
You are correct in thinking that is a good solution. But, you have to add another query to the process so that after the exporting is complete of those unticked records this update query runs ticking all the unticked records.

UPDATE Table1 SET Table1.ticked = True
WHERE (((Table1.ticked)=False));

Save as "qryUpdateTickedTrue"

This could all be done behind a button on the Switchboard using the following:

DoCmd.TransferText acExportDelim, , Table1, "c:\exportfiles\table1export.txt", True
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateTickedTrue"
docmd.SetWarnings True

This should get you started on the right track. You will have to modify this to include your table names and field names and the path/exportfilename that want to use.

Good luck. Bob Scriver
 
Thanks scriverb,

I'm testing it now and it looks good!

May
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top