Results 1 to 2 of 2
  1. #1
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81

    Question Monthly Archiving # Of Records In Tables

    Hi all,



    I'm looking for some guidance on the best way to proceed here. I have a database that imports a series of flat files (mostly .xlsx or .csv) on a monthly basis. There's actually a button on the main form that, once clicked, goes out and imports about 10 files that are saved to varying locations (shared drives/folders) on our network. Each of these files is imported into a different table in the database. There's a separate procedure for each one, but they are all located within the same module. This process is run on the 1st of each month (or next closest date if the 1st falls on a weekend) - and only once per month.
    What I'm looking to do is incorporate an archive process - though I don't actually need to archive all of the records being imported. Rather, I just need to create an archive that shows the number of records imported into those 10 tables each month.

    For the archive table, my plan is to create a table with:
    • ID (Autonumber)
    • File Name (this represents the name of each of those 10 files being imported)
    • Count (this would be the total # of records that were imported for the listed file)
    • Month Number
    • Year


    Now as far as the process of actually archiving that data each month.. I could create 10 separate 'Append' queries that would run after each respective file is imported. Each query would simply append the count of records into the archive table for that particular file (after importing the data for it) and then also insert the current month number and year.
    This seems like it would work just fine, but I'm wondering if there's a more sophisticated and/or efficient approach to doing this then running 10 separate append queries each month. Is there a fairly straightforward way to create a standalone function in VBA (e.g.: perhaps tacked onto the same module that's used to import the files) as opposed to creating a bunch of queries?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Yes, VBA could sequentially run 10 separate SQL INSERT actions. Yes, this could be done in the same module that accomplishes the imports.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 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. Archiving mystery records and linking to current records
    By Girraffa in forum Database Design
    Replies: 4
    Last Post: 12-04-2017, 05:17 PM
  2. Archiving updated records
    By Payner in forum Access
    Replies: 4
    Last Post: 10-12-2014, 02:24 AM
  3. Archiving Records
    By robsworld78 in forum Forms
    Replies: 5
    Last Post: 06-03-2011, 05:00 AM
  4. Archiving records
    By NOTLguy in forum Access
    Replies: 3
    Last Post: 11-21-2010, 03:15 PM
  5. Archiving old records
    By dean in forum Access
    Replies: 7
    Last Post: 09-14-2009, 02:54 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