G
graeme34 via AccessMonster.com
Hi could any body tell me why a query would run when manually opened, yet
when called from a procedure it fails saying it is expecting 1 parameter..
Here is the calling code..
DoCmd.DeleteObject acTable, "tblTempGoodsSent"
CurrentDb.QueryDefs("qryMakeDespatchTable").Execute (dbFailOnError)
Here is the qryMakeDespatchQuery..
SELECT qryDespatchSubLine.SalesOrderNumber, qryDespatchSubLine.[Product Code],
qryDespatchSubLine.Description, qryDespatchSubLine.Price, qryDespatchSubLine.
QuantityOrdered, qryDespatchSubLine.Outstanding, qryDespatchSubLine.[Quantity
Sent], qryDespatchSubLine.VATRate INTO tblTempGoodsSent
FROM qryDespatchSubLine
WHERE (((qryDespatchSubLine.SalesOrderNumber)=Forms!frmChooseOrderNumber!
txtOrderNumberChoice) And ((qryDespatchSubLine.Outstanding)>0));
The query works fine when opened by double clicking the object name from the
query objects list but not from within the code??
when called from a procedure it fails saying it is expecting 1 parameter..
Here is the calling code..
DoCmd.DeleteObject acTable, "tblTempGoodsSent"
CurrentDb.QueryDefs("qryMakeDespatchTable").Execute (dbFailOnError)
Here is the qryMakeDespatchQuery..
SELECT qryDespatchSubLine.SalesOrderNumber, qryDespatchSubLine.[Product Code],
qryDespatchSubLine.Description, qryDespatchSubLine.Price, qryDespatchSubLine.
QuantityOrdered, qryDespatchSubLine.Outstanding, qryDespatchSubLine.[Quantity
Sent], qryDespatchSubLine.VATRate INTO tblTempGoodsSent
FROM qryDespatchSubLine
WHERE (((qryDespatchSubLine.SalesOrderNumber)=Forms!frmChooseOrderNumber!
txtOrderNumberChoice) And ((qryDespatchSubLine.Outstanding)>0));
The query works fine when opened by double clicking the object name from the
query objects list but not from within the code??