How to Fix Microsoft Access Error 3061: Too Few Parameters Expected
Question details
The user is attempting to resolve Error 3061 ('Too few parameters. Expected 1') when using DAO to open a saved query in VBA.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Running a saved query that references a form control using the CurrentDb.OpenRecordset method in VBA.
- Observed behavior
- The query executes successfully when run from the Access Navigation Pane or within a form, but triggers Error 3061 when triggered via VBA code because DAO fails to resolve the form control reference.
Before modifying your database code, ensure you have backed up your Access database (.accdb) to prevent accidental data loss, and verify that all field names in your query are spelled correctly.
Build the SQL Statement Dynamically in VBA
Fix the parameter error by concatenating the form control values directly into the SQL string before opening the recordset.
DAO does not use the Access Expression Service, which means it cannot automatically resolve form control references (such as Forms!FormName!ControlName) inside saved queries. To resolve this, you need to construct the SQL query dynamically inside your VBA module.
Press ALT + F11 to open the Microsoft Visual Basic for Applications (VBA) editor and locate the module containing the failed OpenRecordset code.
Define a variable to hold your SQL query by typing: Dim strSQL As String
If your parameter is a number, append it directly to the SQL string: strSQL = "SELECT * FROM TableName WHERE OrderNumber = " & Forms!OrderEntry!OrderNumber
If the parameter is a text string, enclose it in single quotes: strSQL = "SELECT * FROM TableName WHERE CustomerName = '" & Forms!OrderEntry!CustomerName & "'"
Replace the saved query name in your code with the new SQL string: Set rst = CurrentDb.OpenRecordset(strSQL)

Use QueryDefs to Evaluate Parameters
Evaluate parameters via the DAO QueryDef object to keep your existing saved query intact without rewriting SQL in VBA.
Looking for a Lightweight Office Suite? Try WPS Office
While Microsoft Access manages your relational databases, exporting and analyzing that data often requires a reliable spreadsheet tool. WPS Office provides a powerful, free alternative for Microsoft Excel, Word, and PowerPoint files. It easily handles exported database tables (.csv or .xlsx) with advanced data processing and pivot tables.
- 1. Download and Install: Get WPS Office for free from the official website and follow the quick installation prompt.
- 2. Import Exported Data: Export your Access query results as an Excel or CSV file and open it seamlessly in WPS Spreadsheet.
- 3. Analyze and Report: Use WPS Spreadsheet's built-in formulas, charts, and PivotTables to analyze your database extracts effectively.

Frequently Asked Questions
Why does my query work in the Navigation Pane but fail in VBA?
When you run a query from the Access Navigation Pane or use it as a Form RecordSource, the Access Expression Service automatically evaluates and resolves references like 'Forms!MyForm!MyControl'. However, DAO (Data Access Objects) used in VBA bypasses this service, treating unresolved form references as missing parameters.
Can a misspelled field name cause Error 3061?
Yes. Error 3061 frequently occurs due to typographical errors. If a field name or table name in your SQL string or saved query does not match the actual database schema exactly, the database engine cannot locate it and assumes it is an undefined parameter.
How do I fix Error 3061 when using an INSERT INTO statement?
The fix is identical to the SELECT statement solution. You must construct the INSERT INTO string dynamically in VBA. Ensure you concatenate variables properly, remembering to use single quotes for text values and hash symbols (#) for date values before executing CurrentDb.Execute strSQL.




