I have a question I have a table1 and table2 . Table1 has the field 'trandate', right now table2 is empty without any data in it. I am trying to read and loop through all the records in recordset and then transfer it to table2. Here is my code.
I am missing something. Please help me very urgent.
Thanks a lot.
Public Function convertdate()
Dim db As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Set db = CurrentDb
Set rs1 = db.OpenRecordset("table1", dbOpenDynaset)
rs1.MoveFirst
If Not rs1.EOF Then
Set rs2 = db.OpenRecordset("table2", dbOpenDynaset)
Do Until rs1.EOF
With rs1
.AddNew
.Fields("trandate"
= rs2.Fields("trandate"
.Update
End With
Loop
End If
rs1.MoveNext
End Function
Thanks again
I am missing something. Please help me very urgent.
Thanks a lot.
Public Function convertdate()
Dim db As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Set db = CurrentDb
Set rs1 = db.OpenRecordset("table1", dbOpenDynaset)
rs1.MoveFirst
If Not rs1.EOF Then
Set rs2 = db.OpenRecordset("table2", dbOpenDynaset)
Do Until rs1.EOF
With rs1
.AddNew
.Fields("trandate"
.Update
End With
Loop
End If
rs1.MoveNext
End Function
Thanks again