Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with the following error message...

Status
Not open for further replies.

zahara666

Technical User
Nov 1, 2001
78
CA
Too few parameters. Expected 2

When I have the following line:

Set rst = dbs.OpenRecordset("InvoiceQuery")

InvoiceQuery is a simple query with many columns... rst is a recordset and dbs is the currentdb..

any ideas?
 
How do you mean run it directly? If I take out that line, the query runs no problem. I need that line because I need to add to the query.. Hope that makes sense?

Julie
 
I mean can you double-click on the query in the db window to run it. Please post the SQL.
 
Here is the SQL code that is giving me much trouble on the openrecordset command:

SELECT Int1Table.InvoiceNumber, ClientTable.ClientName, ClientTable.ClientContact, ClientTable.Address1, ClientTable.Address2, ClientTable.City, ClientTable.Zip, Int1Table.FileNum, Int1Table.LastName, Int1Table.FirstName, Int1Table.LOS, Int1Table.Rate, Int1Table.Surcharge, Int1Table.Total, Int1Table.Invoiced, Int1Table.Received, Int1Table.ClientCode
FROM ClientTable INNER JOIN Int1Table ON ClientTable.ClientCode = Int1Table.ClientCode
WHERE (((Int1Table.Invoiced)=False) AND ((Int1Table.Received) Between [Forms]![InvoiceForm]![FromDate] And [Forms]![InvoiceForm]![ToDate]) AND ((Int1Table.ClientCode)='28000' Or ([Int1Table].[ClientCode])='28010' Or ([Int1Table].[ClientCode])='28012' Or ([Int1Table].[ClientCode])='28020')) ORDER BY Int1Table.ClientCode;

But the Int1Table.ClientCode = '#####' could go on for many more... There is just 4 to show you..

Thanks for your help!!
Julie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top