ACC: "Too few parameters" Using AddAllToList() Function (141620)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q141620 SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you try to open a parameter query from code, as is done in the
AddAllToList() function provided in the Developer Solutions sample
application (Solutions.mdb), you may receive the following error message:
Too few parameters. Expected 1.
CAUSE
The combo box or list box's RowSource property is set to an SQL statement
or query object name that is a parameter query. The parameter query may be
used to limit the selection of items in the list based on a selection in a
different list or control on the form. When opening a recordset on a query
in Visual Basic, which the AddAllToList() function attempts to do, the
parameters must be filled in explicitly.
RESOLUTION
Modify the AddAllToList() function to explicitly fill in the parameters for
the recordset being used.
The steps to reproduce the behavior are provided below using the
SelectProduct combo box on the EditProducts form in the Developer Solutions
sample application. Further information is provided demonstrating how you
can work around this behavior by creating a copy of the AddAllToList()
function and modifying it to explicitly fill the parameters to the
LimitProductList query used to populate the SelectProduct combo box.
REFERENCES
For more information about parameters, search for "parameter queries" using
the Microsoft Access 97 Help Index.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kberrmsg kbprb KB141620 |
---|
|