What is the code to open a table and select record to insert into a new table.
Thanks
GinnyP
Howdo GinnyP, here is a simple DAO example
DAO is one method of accessing the data. The other method is ADO, but I find DAO more suited to Access.
If it complains about DAO, then go to Tools/References and add Microsoft DAO Object library (latest version!!!)
'Define a recordset
dim rs as dao.recordset
'Using current open db, open the table
set rs=currentdb.openrecordset("mytable")
'Add a record
'Prepare recordset for add
rs.AddNew
rs!field1 = "somevalue"
rs!field2 = 123
'Issue the add
rs.Update
'Close down recordset and free memory - IMPORTANT TO DO THIS
rs.close
set rs=nothing
note, field1 is a string field in table "mytable"
and field2 is a numeric field in table "mytable"