M
magicdds
I keep getting an error message when trying to run the following code:
Dim rstDayFile As DAO.Recordset
Dim strSql As String
Dim dbs As DAO.Database
Dim mes As String
Set dbs = CurrentDb
strSql = "SELECT * FROM RecallQuery WHERE PatID > 0"
Set rstDayFile = dbs.OpenRecordset(strSql)
Do While rstDayFile.EOF = False
mes = rstDayFile.Fields(0)
MsgBox mes
rstDayFile.MoveNext
Loop
rstDayFile.Close
The error message is:
Run Time Error "3061"
Too few parameters. Expected 2
The error occurs when trying to execute
Set rstDayFile = dbs.OpenRecordset(strSql)
Can anyone tell me what I am doing wrong.
Thanks
Dim rstDayFile As DAO.Recordset
Dim strSql As String
Dim dbs As DAO.Database
Dim mes As String
Set dbs = CurrentDb
strSql = "SELECT * FROM RecallQuery WHERE PatID > 0"
Set rstDayFile = dbs.OpenRecordset(strSql)
Do While rstDayFile.EOF = False
mes = rstDayFile.Fields(0)
MsgBox mes
rstDayFile.MoveNext
Loop
rstDayFile.Close
The error message is:
Run Time Error "3061"
Too few parameters. Expected 2
The error occurs when trying to execute
Set rstDayFile = dbs.OpenRecordset(strSql)
Can anyone tell me what I am doing wrong.
Thanks