-2

I have a continuous form in MS Access that I would like to create a table from. Most of the fields are populated by a query, but some fields will be user entered and there will also be calculated fields. Basically I need to create a snapshot of the data when a users clicks a button at any given point and then save the table with the value of one of the fields and that particular date. What is the best way to achieve this?

Thank you! -Charlie

Chuck0185
  • 531
  • 3
  • 15
  • 36
  • Your question is too broad for this site. If you're looking for a tutorial, search for one. Once you hit a *specific* coding issue, you'll have SO question material. Rule of thumb, if you haven't written anything yet, your question is likely off-topic. – Mathieu Guindon Apr 07 '17 at 20:22

1 Answers1

2

What you actually want to do is learn how to use recordset clones. You should also reuse a table seeing in how there is a pretty good chance you'll want fresh data on each pull.

Because this isnt a code writing service, ill let you figure out the details, but this should be plenty to get you started.

Sub Print_Field_Names() 
Dim rst As Recordset, intI As Integer 
Dim fld As Field 

dim vbSql as string
vbSql = "DELETE * FROM Tbl"
DoCmd.RunSQL vbSql


Set rst = Me.RecordsetClone 
For Each fld in rst.Fields 
    ' Print field names. 
    Debug.Print fld.Name 
Next 
End Sub

In the loop through the original recordset clone, you should try for yourself how to edit another recordset on your reusuable table to "Fill" the new table with your form data. this is actually really simple and the masochist in me wants you to actually suffer since you didnt try anything on your own first :P

Doug Coats
  • 6,255
  • 9
  • 27
  • 49
  • Thanks Doug! So I would actually like to save the newly created table to the database so that it could be accessed and compared against at a later time. – Chuck0185 Apr 07 '17 at 20:43
  • @Chuck0185 I edited my answer to actually me more correct and more helpfulish – Doug Coats Apr 07 '17 at 21:33