D
donaldg
Hi, I've been going at this for hours, apologies for my cluelessness.
I'm trying to extract records from a table in MSA 2003, alter them and
append them as new records, which is the point where it's breaking. I pasted
my latest attempt below, (>> where it breaks). I'm also quite open to
learning a better way to skin this cat overall, as this is my first venture
into recordsets. Thanks!
strSQL = "SELECT a002t_titling.* FROM a002t_titling WHERE a001t_el_id =
" & varElPreFillID
Set rsPrefill = New ADODB.Recordset
rsPrefill.Open strSQL, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
strSQL = "a002t_titling"
Set rsNew = New ADODB.Recordset
Set rec = New ADODB.Record
rsNew.Open strSQL, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
While Not rsPrefill.EOFrsNew.AddNew rec
rsNew!a001t_el_id = varNewElID
rsNew.Update
rsPrefill.MoveNext
rec.Close
Wend
I'm trying to extract records from a table in MSA 2003, alter them and
append them as new records, which is the point where it's breaking. I pasted
my latest attempt below, (>> where it breaks). I'm also quite open to
learning a better way to skin this cat overall, as this is my first venture
into recordsets. Thanks!
strSQL = "SELECT a002t_titling.* FROM a002t_titling WHERE a001t_el_id =
" & varElPreFillID
Set rsPrefill = New ADODB.Recordset
rsPrefill.Open strSQL, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
strSQL = "a002t_titling"
Set rsNew = New ADODB.Recordset
Set rec = New ADODB.Record
rsNew.Open strSQL, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
While Not rsPrefill.EOFrsNew.AddNew rec
rsNew!a001t_el_id = varNewElID
rsNew.Update
rsPrefill.MoveNext
rec.Close
Wend