Returning a row from SQL and storing in local table

JohnITD

New member
Local time
Today, 13:35
Joined
Oct 8, 2007
Messages
3
Hi all!

I have a bit of an issue. Im trying to retrieve a row from SQL and insert it into my local DB table.

However, when I try and execute the code, I get an error message. The data had not been inserted into my local DB table.

Here is the code:

strsql = "INSERT INTO EntryDetail_Local SELECT EntryDetails.* FROM EntryDetails where entrykeyid = " & plngentrykeyid & ";"
Set qdftemp = mydb.QueryDefs("qry_Append_EntryDetail_Local")
qdftemp.SQL = strsql
qdftemp.Close
qdftemp.Execute
DoEvents

Any ideas?

Cheers
 
What error message are you getting?
 
The following error occured: The record is deleted. [3167]

I know that there is an issue getting the data from the SQL table and inserting it into the local DB table. The problem is I dont know what is causing it.

I am using an .mdb file BTW
Also I can copy and paste the data from the SQL table direct into the local DB table.

Any Ideas?

cheers
 

Users who are viewing this thread

Back
Top Bottom