funderburgh
Registered User.
- Local time
- Yesterday, 23:12
- Joined
- Jun 25, 2008
- Messages
- 118
I have developed a query to determine a student's class ranking for use while printing a transcript. The graduating year is a parameter.
I currently have the criteria for the parameter set to a combo box in the form that executes the report, but I am getting an error. Here is my code:
Private Sub Report_Load()
Dim dbs As DAO.Database
Dim rsRankQuery As DAO.Recordset
Dim intCount As Integer
Dim strRank As String
strRank = "Not Applicable"
MsgBox [Forms]![Main Navigation]![Print Menu]![SchoolYear]
' (this is the value of the criteria in the query)
Set dbs = CurrentDb
Set rsRankQuery = dbs.OpenRecordset("Class Rank", dbOpenDynaset)
The Set command returns the following error: "Run Time 3601 Too Few Parameters, Expected 1.
I don't get the message when I hard code the criteria. The MsgBox returns the correct data, and with the form open and filled in the Query runs correctly when it is executed stand alone.
I am also using this exact criteria syntax in other queries successfully, but none in a Set command.
Any help is welcome. Thanks
I currently have the criteria for the parameter set to a combo box in the form that executes the report, but I am getting an error. Here is my code:
Private Sub Report_Load()
Dim dbs As DAO.Database
Dim rsRankQuery As DAO.Recordset
Dim intCount As Integer
Dim strRank As String
strRank = "Not Applicable"
MsgBox [Forms]![Main Navigation]![Print Menu]![SchoolYear]
' (this is the value of the criteria in the query)
Set dbs = CurrentDb
Set rsRankQuery = dbs.OpenRecordset("Class Rank", dbOpenDynaset)
The Set command returns the following error: "Run Time 3601 Too Few Parameters, Expected 1.
I don't get the message when I hard code the criteria. The MsgBox returns the correct data, and with the form open and filled in the Query runs correctly when it is executed stand alone.
I am also using this exact criteria syntax in other queries successfully, but none in a Set command.
Any help is welcome. Thanks