Hi Guys,
This things been driving me nuts.
What i'm trying to do is copy certain fields from one table into another.
Heres part of the code I'm using...
Dim rst as dao.recordset
Dim rst1 as dao.recordset
Set rst = CurrentDb.OpenRecordset("Entry_Log")
Set rst1 = CurrentDb.OpenRecordset("Premium Freight Log")
rst1.MoveLast
rst.AddNew
rst.Fields(0).Value = rst1.Fields(0).Value
rst.Fields(1).Value = Now()
rst.Fields(2).Value = rst1.Fields(13).Value
rst.Update
The problem is with the rst1.MoveLast line.
The last entry in the table has Field 0 value 558 (autonumber field)
however when I step through the above code it displays rst1.field(0).value = 338
What am I doing wrong over here. Your help would be much appreciated.
Thanks guys
This things been driving me nuts.
What i'm trying to do is copy certain fields from one table into another.
Heres part of the code I'm using...
Dim rst as dao.recordset
Dim rst1 as dao.recordset
Set rst = CurrentDb.OpenRecordset("Entry_Log")
Set rst1 = CurrentDb.OpenRecordset("Premium Freight Log")
rst1.MoveLast
rst.AddNew
rst.Fields(0).Value = rst1.Fields(0).Value
rst.Fields(1).Value = Now()
rst.Fields(2).Value = rst1.Fields(13).Value
rst.Update
The problem is with the rst1.MoveLast line.
The last entry in the table has Field 0 value 558 (autonumber field)
however when I step through the above code it displays rst1.field(0).value = 338
What am I doing wrong over here. Your help would be much appreciated.
Thanks guys