Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-21-2006, 02:45 AM
dannewestis dannewestis is offline
Registered User
 
Join Date: Sep 2006
Posts: 12
dannewestis is on a distinguished road
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.
Reply With Quote
Sponsored Links
  #2  
Old 09-21-2006, 06:31 AM
FoFa's Avatar
FoFa FoFa is offline
Registered User
 
Join Date: Jan 2003
Location: Texas, USA
Posts: 3,580
FoFa is on a distinguished road
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
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple lookup values into one table field Hodgers Tables 3 07-20-2009 06:50 AM
Procedure too large, what can I do?? wh00t Modules & VBA 15 01-17-2008 06:05 PM
Working on design tutorial Kraj Theory and practice of database design 29 08-11-2006 09:40 AM
Yes/no Enable Disable aldeb Forms 8 06-02-2005 11:42 AM
Calculate Field Value for entire Table pcnetmd Macros 2 07-13-2004 06:06 AM


All times are GMT -8. The time now is 05:34 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World