BigKingDave
Programmer
I am trying to create and edit a new record in an existing table called Transactions. It has 3 records in. When the code below runs, it creates the new record. (Record 4), but updates Record 3 - NOT the new one. The field I want to update is called 'Balence'. Any help apopreciated. I have run this code or similar to update new records previously and it has worked fine.
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
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