G
Guest
Hi,
i have a form which facilitates the user to edit the records in a subform.
I have an undo method, which can either undo the current record, or wipe any
changes and restore the table to the point at which the form was opened. i.e
this is what i have in the form_Load procedure
Set thisdb = CurrentDb
strSQL = "SELECT * FROM CONNECTIVITY_DATA_" & boatnum & " WHERE CKT =
'" & CKT & "';"
Me.frmConnectivityData.Form.RecordSource = strSQL 'fill the subform
Me.frmConnectivityData.Form.Requery
Set rstBackup = thisdb.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly)
rstBackup.MoveLast
boatnum is a number (i have different tables with the name only differing by
the number, and CKT is a field in these tables.
In the undo method, i would have something like
(actual columns arent called DATA!)...
'open a recordset that has the current records in it (not shown)
with rstActual
.edit
'add new / edit data
![DATA1] = rstBackup![DATA1]
![DATA2] = rstBackup![DATA2]
'approx 20 more
..update
end with
As i am doing a straight copy between recordsets, it seems tedious to refer
to each field in turn each time i want to call this method. (this could be
hundreds of times if i want to reset the whole table to its original state)
is there a way that i could use the contents of a recordset in an sql
statement?
other than that, is there a way to mass copy records from one recordset to
another?
i have a form which facilitates the user to edit the records in a subform.
I have an undo method, which can either undo the current record, or wipe any
changes and restore the table to the point at which the form was opened. i.e
this is what i have in the form_Load procedure
Set thisdb = CurrentDb
strSQL = "SELECT * FROM CONNECTIVITY_DATA_" & boatnum & " WHERE CKT =
'" & CKT & "';"
Me.frmConnectivityData.Form.RecordSource = strSQL 'fill the subform
Me.frmConnectivityData.Form.Requery
Set rstBackup = thisdb.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly)
rstBackup.MoveLast
boatnum is a number (i have different tables with the name only differing by
the number, and CKT is a field in these tables.
In the undo method, i would have something like
(actual columns arent called DATA!)...
'open a recordset that has the current records in it (not shown)
with rstActual
.edit
'add new / edit data
![DATA1] = rstBackup![DATA1]
![DATA2] = rstBackup![DATA2]
'approx 20 more
..update
end with
As i am doing a straight copy between recordsets, it seems tedious to refer
to each field in turn each time i want to call this method. (this could be
hundreds of times if i want to reset the whole table to its original state)
is there a way that i could use the contents of a recordset in an sql
statement?
other than that, is there a way to mass copy records from one recordset to
another?