I am attempting to use the instructions from the following past post...
However its not working for me, what could I be doing wrong?
I copied the posted code and placed it into a module called modGetRowNumber. I have the DAO setup properly as I use it for other procedures. I then opened my query "qrySubFrmTimeSheet" and as per the instructions added a new field that I called RowNum and has the following in it..
TimeSheetID is the primary key of the TimeSheet table that I am querying.
When I now run my query "qrySubFrmTimeSheet", I get an error..
Run-Time error '3061':
Too few parameters. Expected 2.
If I click on the Debug button it highlights the following line in the modGetRowNumber module..
"Set rst = CurrentDb.OpenRecordset("S
ELECT [" & strIDField & "]" & " FROM " & strQueryName, dbOpenSnapshot)"
If I move my mouse over "strIDField" it displays "TimeSheetID". If I move my mouse over "strQueryName" it displays "qrySubFrmTimeSheet". If I move my mouse over "dbOpenSnapshot" it displays "4".
So does anyone have ideas what I'm doing wrong?