BigKingDave
Programmer
I want to create a new record in an existing table 'Transactions', and add a value to the field 'Balence'. 'Balence' is a Currency field. Lets say table has three recods in to start with.
When I run the following code, it creates the new record,(Record 4), but puts the value in Record 3. This indicates that the MoveLast method is not working.
Any help would be greatly appreciated.
Private Sub Command12_Click()
Dim MyDB As Database
Dim MyRS As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyRS = MyDB.OpenRecordset("TblTransactions", DB_OPEN_TABLE)
MyRS.AddNew
MyRS.Update
MyRS.MoveLast
MyRS.Edit
MyRS![Balence] = 1000
MyRS.Update
End Sub
When I run the following code, it creates the new record,(Record 4), but puts the value in Record 3. This indicates that the MoveLast method is not working.
Any help would be greatly appreciated.
Private Sub Command12_Click()
Dim MyDB As Database
Dim MyRS As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyRS = MyDB.OpenRecordset("TblTransactions", DB_OPEN_TABLE)
MyRS.AddNew
MyRS.Update
MyRS.MoveLast
MyRS.Edit
MyRS![Balence] = 1000
MyRS.Update
End Sub