-
Hi,
Here is an interesting question.Can anyone tell me the solution to this..
if i have table1 with 5 rows, and table2 with 10 rows (similar table structure), thru coding how do i append all 10 rows to table1 ....
Interesting isn't it.Any help will be highly appreciated.
Regards
-
maybe more detailed information will help to get usefull answers. are you using a database (if so, which one) ...
best regards
Sascha
-
I never tested it out but this might be an idea. Maybe there is a better way.
Usage: AppendTable Table1, Table2
This should append Table1 onto Table2. If I did the code right, anyway.
Public Sub AppendTable(rs1 As ADODB.Recordset, rs2 As ADODB.Recordset)
Dim rc As Integer, i As Integer, j As Integer
rs1.MoveLast
rs1.MoveFirst
rc = rs1.RecordCount
For i = 1 To rc
rs2.AddNew
For j = 0 To rs2.Fields.Count - 1
rs2.Fields(j).Value = rs1.Fields(j).Value
Next j
rs2.MoveNext
Next i
End Sub
If this isn't what you are talking about let me know.