Click to See Complete Forum and Search --> : AddNew->Update->Delete->get an error


simonkwan
December 20th, 1999, 09:35 PM
Hi, I get an error of "could not locate the row ..." when I delete a row which just added, why ? But it can be deleted when i quit the program and then execute again.
Thank you !


private Sub Command1_Click()
DataEnvironment1.rscncustomer.AddNew
me.txtCUSTID = "123456"
me.txtCUSTNAME = "ABC Company"
DataEnvironment1.rscncustomer.Update
DataEnvironment1.rscncustomer.Delete
End Sub

Rouven Thimm
December 29th, 1999, 02:44 PM
I'm not sure if this will fix the problem, I have not worked that long with VB yet, but with recordsets I always use a 'MoveLast' before taking any further action, because there you sometimes have the trouble, that the location after the Update is not on the new entry but actually behind it...