Excel Param query

Idarac
Idarac used Ask the Experts™
on
I have a query that I was given to work with see SQL below. In it has "Between Param("InvTotalsTransStartDate") And Param("InvTotalsTransEndDate")"
 

QUERY SQL

INSERT INTO tblRepInvoiceTotalsMonthly ( CompanyName, Mth, TotalCommission, CustomerId )
SELECT tblCustomer.CompanyName, DateSerial(Year([TransactionDate]),Month([TransactionDate]),1) AS Mth, Sum(qryDealsBoth.CommissionAmount) AS TotalCommission, qryDealsBoth.CustomerId
FROM tblCustomer INNER JOIN qryDealsBoth ON tblCustomer.CustomerId = qryDealsBoth.CustomerId
WHERE (((tblCustomer.ClearingHouse)=0) AND ((qryDealsBoth.TransactionDate) Between Param("InvTotalsTransStartDate") And Param("InvTotalsTransEndDate")) AND ((qryDealsBoth.Void)=0) AND ((tblCustomer.BillingType)="Front End") AND ((qryDealsBoth.PFLCompanyUsed)=IIf(Param("InvoicingTotalsPFLCompany")="<<All>>",[PFLCompanyUsed],Param("InvoicingTotalsPFLCompany"))))
GROUP BY tblCustomer.CompanyName, DateSerial(Year([TransactionDate]),Month([TransactionDate]),1), qryDealsBoth.CustomerId;


When I try and load these parameters I get an error Item not found 3265. See code below.
    Set myAppqd = mydb.QueryDefs("qryRepCommissionByBrokerInvFE")
    myAppqd("InvTotalsTransStartDate") = Me.TransactionStartDate
    myAppqd("InvTotalsTransEndDate") = Me.TransactionEndDate
    myAppqd.Execute

Does anyone know what I am missing here?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2014

Commented:
I don't see your code setting the Param("InvoicingTotalsPFLCompany") value.

Author

Commented:
Param("InvTotalsTransEndDate") hidden the code above. Anyway I figured it out Thanx
Top Expert 2014

Commented:
What was the cause of the error?  Please post that and then accept your comment as the solution to the problem.
Commented:
Silly but param was actually a function being called from a module.

Author

Commented:
I found the answer myself

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial