| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Setting table field to true when exporting to csv
Hi,
I export a query as csv to upload to another database on a web site. When that csv file has been exported I'd like the query to be emptied, so that the next time I export I don't export duplicates. What's the easiest way to do that? I've been thinking of having a field in the table with a check box that is checked when the file is exported. The query then selects only those records where that box is not checked. But how can I check those boxes on Export rather than when I run the query? The reason being that I may want to preview by running the query, without having that affecting the check box. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
I think the best way is to create a select query that always selects the records you want to export. In that select query, ONLY select the primary key field. Then in your export query, in the criteria, use IN (SELECT [primarykey] from myselect query). Then AFTER tha actual export is run, run an update query to update your export flag and in it's criteria use the same IN (SELECT [primarykey] from myselect query). These subselects for the IN would go in the criteria for the primary key. This way you can break them apart and only run the second one after the actual export was run. Also if the record selection needs to change for some reason, you only have to change the SELECT query and both of those queries will be fine still.
__________________
E Pluribus Unum - Out of Many, One |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple lookup values into one table field | Hodgers | Tables | 3 | 07-20-2009 05:50 AM |
| Procedure too large, what can I do?? | wh00t | Modules & VBA | 15 | 01-17-2008 05:05 PM |
| Working on design tutorial | Kraj | Theory and practice of database design | 29 | 08-11-2006 08:40 AM |
| Yes/no Enable Disable | aldeb | Forms | 8 | 06-02-2005 10:42 AM |
| Calculate Field Value for entire Table | pcnetmd | Macros | 2 | 07-13-2004 05:06 AM |