Results 1 to 3 of 3
  1. #1
    brewtopia is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019

    automating exports and query changes

    I have a simple query to extract records for a specific date. And then I have to export the resulting table to .csv file.
    However I have to do this for over 450 days so 450+ times of changing the date in the query and then exporting the table.
    Is there a simple way to automate this process so my query will change the date and export automatically?
    Sorry I am a novice in access.


  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Nevada, USA
    Simplest way might be to have it refer to a form textbox instead of having a hard coded date. You can then create a VBA process that loops your days, puts the date in the textbox and then outputs the query (OutputTo). If the days are in a table you'd loop that, or if it's 450 days starting on a certain date you could use a loop where you started with that date and incremented a date variable 450 times.
    Paul (wino moderator)
    MS Access MVP 2007-2019

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    The Great Land
    You have to do 450 exports in a single work session?

    One way is to have query object reference unbound textbox on form, like:

    SELECT * FROM table WHERE somefield = Forms!formname!controlname;

    Then looping code can incrementally set value in that textbox.

    Another is within loop to apply filter to a report, open report, export report, close report, repeat.
    How to attach file: To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Appending SAP exports Every Day
    By ShennyP in forum Access
    Replies: 7
    Last Post: 03-01-2019, 01:00 AM
  2. Blank row on Exports
    By BullwinkleTMoose in forum Import/Export Data
    Replies: 1
    Last Post: 08-30-2016, 03:01 PM
  3. Replies: 2
    Last Post: 04-08-2015, 12:43 PM
  4. Replies: 1
    Last Post: 03-11-2014, 09:29 AM
  5. Problem with Query exports to Excel
    By nokeefe in forum Access
    Replies: 9
    Last Post: 12-07-2011, 12:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Other Forums: Microsoft Office Forums - Senior Forums