Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim n As Integer
Dim strSQL As String
Set db = CurrentDb
strSQL = "Select * from [Duh Query]"
Set rs = db.OpenRecordset(strSQL)
This code is on a control (controlA), on a form (FormA), on afterupdate.
It works fine until I put a parameter in the query
The parameter in criteria: [Forms]![FormA]![controlA]
The debugger highlights the line - Set rs = db.OPenRecordset(strSQL)
The error message is: Too few parameters expected 1
Dim rs As DAO.Recordset
Dim n As Integer
Dim strSQL As String
Set db = CurrentDb
strSQL = "Select * from [Duh Query]"
Set rs = db.OpenRecordset(strSQL)
This code is on a control (controlA), on a form (FormA), on afterupdate.
It works fine until I put a parameter in the query
The parameter in criteria: [Forms]![FormA]![controlA]
The debugger highlights the line - Set rs = db.OPenRecordset(strSQL)
The error message is: Too few parameters expected 1
Last edited: