"Record is deleted" when doing an insert

rob_levy

New member
Local time
Today, 19:34
Joined
Oct 16, 2007
Messages
7
Dear forum,

When running a line similar to this to add a new record to a table:

Code:
DoCmd.RunSQL "INSERT INTO MyTable VALUES (1,2,3)"

I'm getting:

Run-time error 3167: "Record Is Deleted"

When I click debug, I'll get the same error for a few seconds every time I try to run the same line then, after about 5 seconds, the line will run fine and the new record is created.

How can this be? Has anyone ever suffered anything similar to this problem?

Access 97 SR-2, Windows 2000, MSJET35.DLL version: 3.51.3328.0
 
difficult to know without seeing the whole module but:

Code:
DoCmd.RunSQL "INSERT INTO MyTable ( Value1, Value2, Value3 ) VALUES ( 1, 2, 3 )"

or 

CurrentDb.Execute ("DoCmd.RunSQL "INSERT INTO MyTable ( Value1, Value2, Value3 ) VALUES ( 1, 2, 3 )")

I think you were getting the error because you wernt defining the fields to inset the records into thus it was deleting the previous records or watever you runtime error was...
 

Users who are viewing this thread

Back
Top Bottom