Hello,
I have been battling this for a few days now, and there has to be a better way.
I want a button on a form to copy a record from Table 1 DB1 to Table2 DB2. The tables structure is identical.
There is a Auto Primary Key ID on both Table1 and 2.
Both Table 1 and 2 have a large number of fields (about 50)(yes I appreciate this may be bad design).
I can not simply go "INSERT INTO Table2 SELECT * FROM Table1 WHERE <Criteria> because I end up with a primary key in the recordset and when I try to insert it into Table2 I could get a key violation.
I tried to loop over the fields while they are in the recordset and remove the "ID" field - but it doesnt appear you can do that.
I also tried to construct a SQL String but all the escaping and double quotes and # for dates is going to make this a very unpleasant task.
Is there a better approach?
Thanks
Al
I have been battling this for a few days now, and there has to be a better way.
I want a button on a form to copy a record from Table 1 DB1 to Table2 DB2. The tables structure is identical.
There is a Auto Primary Key ID on both Table1 and 2.
Both Table 1 and 2 have a large number of fields (about 50)(yes I appreciate this may be bad design).
I can not simply go "INSERT INTO Table2 SELECT * FROM Table1 WHERE <Criteria> because I end up with a primary key in the recordset and when I try to insert it into Table2 I could get a key violation.
I tried to loop over the fields while they are in the recordset and remove the "ID" field - but it doesnt appear you can do that.
I also tried to construct a SQL String but all the escaping and double quotes and # for dates is going to make this a very unpleasant task.
Is there a better approach?
Thanks
Al