I'm trying to access a query using VBA code. I think I've done it this way 100 times. My code (on a command button) starts like this:
Dim rstDocCount As Recordset
Set rstDocCount = CurrentDb.QueryDefs("DocCount").OpenRecordset
rst.MoveFirst
I get this error message:
Run-time error '3061': Too few parameters. Expected 1.
The Set rstDocCount
line is highlighted yellow.
What am I doing wrong? The only parameter should be the name of the query and I clearly have that.