Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:43:23+00:00 2026-06-07T15:43:23+00:00

Each day ~5000 records are uploaded to tblRecordsCurrent, at some point within the next

  • 0

Each day ~5000 records are uploaded to tblRecordsCurrent, at some point within the next few days when those records have been processed, they need to be moved to tblRecordsHistorical. Each record has a Foreign Key DataSetID that ties it to the date/time it was uploaded (Parent Table).

How, within vba, can I insert a single DataSet of tblRecordsCurrent into the tblRecordsHistorical from tblRecordsCurrent. I cannot insert all columns as both tables contain persisted columns.

I can’t put the entire INSERT INTO tblRecordsHistorical A, B, C, D, E, F... as it is too long for access vba.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:43:25+00:00Added an answer on June 7, 2026 at 3:43 pm

    If you save the query in your Access database, then you can execute in in VBA the following way:

    DoCmd.OpenQuery "yourQueryName", acViewNormal, acEdit
    

    Or

    CurrentDb.OpenRecordset("yourQueryName")
    

    Or

    CurrentDb.Execute "qryAddLoginfoRow"
    

    This allows you to execute the query without having the query stored in your VBA code. But you are also able to execute this via a query in VBA:

    INSERT INTO tblRecordsHistorical (col1, col2...) 
    SELECT col1, col2...
    FROM tblRecordsCurrent
    

    EDIT:

    You can create a long SQL string by concatenating the string together:

    SQLString = "INSERT INTO tblRecordsHistorical (col1, col2...) " & _
                " SELECT ... " & _
                " FROM tblRecordsCurrent "
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been developing a branch happily and each day rebasing each day from
I have a table that contains multiple records for each day of the month,
I have the following array of days of the week, with each day having
Possible Duplicate: How to get the name of each day in next month? I
I have this little script that shows one wisdom each day. so I have
Background I have a dimension table that has a single record for each day.
If I have 7 checkBoxes, one for each day of the week, Can I
We receive 5-10 improvement requests each day from our customers. Some of them are
I have a variable $Date that is automatically updated each day. I would like
So my MVC ignorance is showing more and more each day. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.