Copy Current Record to Different Table

mshelley1

Carbo
Local time
Today, 03:33
Joined
Feb 12, 2006
Messages
45
Is it possible to copy the current record on a form to a different table?
Example:

Form Name = Training Orders bound to a table with the same name.
2nd Table Name = History

I need to export certin fields from the Training Orders Form into the History Table. Below is the way I am trying to make it happen, but it does not work.

With Me.RecordsetClone
.AddNew
![Forms]![History]![Last Name] = Me.[lastname]
.Update


Me.Bookmark = .LastModified




End With


End Sub
 
try this
Dim dbs As DAO.Database
Dim letterhistory As DAO.Recordset
Set dbs = CurrentDb
Set letterhistory = dbs.OpenRecordset("letterhistory")

With letterhistory
.AddNew
!QteNo = Me.QteNo

replace letterhistory with history

and add the fields you want to copy from
so !qte is the history table and its field name and me.qteno would be the form name
this adds a record into the history table with the bits you want watch your spaces if you put some spaces in it will throw a wobbley

hope this helps

grrrr
 

Users who are viewing this thread

Back
Top Bottom