10-03-2000, 01:10 AM
Hi, I am using the ADODB code for desigining the database Application. I have used the master/detail form where datagrid is used for the detail table.Relation between master & detail is one to many. I want to calculate the difference of qty received & qty rejected & write into the final qty received in the detail table. if the record is already available this works fine for the event rowcolchange but if a new record is appended I am getting an error message of "row not found" plz. help me is solving this problem.
03-15-2001, 01:48 PM
Your Application needs sometime after refreshing the newly appended Data.
Do the followings:
ConnectionObjec or CommandObject.Execute an Insert SQL command to AddNew record
Run an API call to wait for 2 seconds or more, for the new record to be saved, and ready.
RecordsetObject.Requery a Select SQL command to retrieve the recordset.
Here is the API call:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Here is how it is called:
Private Sub cmdRefresh_Click()
cnn.Execute "INSERT INTO bla bla;"
rec.Open "SELECT bla bla FROM bla bla:"