Is there a way (with code) to "copy" a row of a recordset and then "paste" it as a new record in the recordset?
For example, you could do the following:
Dim rst as new ADODB.Recordset
Dim cn as ADODB.Connection
Set cn as CurrentProject.Connection
rst.Open "Address", cn, adOpenKeyset, adLockOptimistic
'Save the value of each field to a different variable
strField1 = rst!Field1
strField2 = rst!Field2
.
.
rst.AddNew
rst!Field1 = strField1
rst!Field2 = strField2
.
.
rst.Update
The problem is that if you have a bunch of fields, it is a pain to type them all like that. Is there some way to just get the values of all the fields at once and then store them all at once into a new record?
For example, you could do the following:
Dim rst as new ADODB.Recordset
Dim cn as ADODB.Connection
Set cn as CurrentProject.Connection
rst.Open "Address", cn, adOpenKeyset, adLockOptimistic
'Save the value of each field to a different variable
strField1 = rst!Field1
strField2 = rst!Field2
.
.
rst.AddNew
rst!Field1 = strField1
rst!Field2 = strField2
.
.
rst.Update
The problem is that if you have a bunch of fields, it is a pain to type them all like that. Is there some way to just get the values of all the fields at once and then store them all at once into a new record?