I think I solved it — had to change datatypes in the target table, seems to be working now.
This was working yesterday! but not today. i have an append query and using
[codebox] Dim cmd As New ADODB.Command
Dim rst2 As New ADODB.Recordset
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = “append_query”
Set rst2 = cmd.Execute(, SelectedRow)[/codebox]
It occasionally works but most of the time it errors out with
Expected ‘DELETE’, ‘INSERT’, ‘PROCEDURE’, ‘SELECT’, or ‘UPDATE’.
the append query in question is an append query to another table in the db, and it expects a parameter:
INSERT INTO a whole bunch of values WHERE ((([].FORM_DLN)=[Enter DLN]));
The append query was re-edited to map to some different fields in the source data but otherwise not changed. if i run it manually it is fine.
Is there a way to attach a parameter to RunSQL?
TIA