L
Lee
Hello
The following statement works:
CurrentDb.Execute ("INSERT INTO tblPayments (salesconsultantid) SELECT
salesconsultantid FROM tblContracts"), dbFailOnError
But when I change tblContracts to qryWeeklystatementsbase:
CurrentDb.Execute ("INSERT INTO tblPayments (salesconsultantid) SELECT
salesconsultantid FROM qryWeeklystatementsbase"), dbFailOnError
I get a too-few parameters error.
The following statement also works:
DoCmd.OpenQuery "qryWeeklystatementsbase"
indicating that query qryWeeklystatementsbase exists and I typed the name
in correctly.
There is definitely a field in qryWeeklystatementsbase called
salesconsultantid. Does this mean you can't insert from a query? I can
always copy the query itself into the code and try that but I was hoping to
avoid that. Or am I possibly doing something else wrong?
The following statement works:
CurrentDb.Execute ("INSERT INTO tblPayments (salesconsultantid) SELECT
salesconsultantid FROM tblContracts"), dbFailOnError
But when I change tblContracts to qryWeeklystatementsbase:
CurrentDb.Execute ("INSERT INTO tblPayments (salesconsultantid) SELECT
salesconsultantid FROM qryWeeklystatementsbase"), dbFailOnError
I get a too-few parameters error.
The following statement also works:
DoCmd.OpenQuery "qryWeeklystatementsbase"
indicating that query qryWeeklystatementsbase exists and I typed the name
in correctly.
There is definitely a field in qryWeeklystatementsbase called
salesconsultantid. Does this mean you can't insert from a query? I can
always copy the query itself into the code and try that but I was hoping to
avoid that. Or am I possibly doing something else wrong?