Hi all.
I am having a problem with a very simple piece of work. I cannot ever remeber there being an issue with this before.
I have a form which has a textfield which has a date in it.
I have a Select query that selects from a simple table all records that match the date that is in the textfield.
In my code, I want to open this query to see if there are any records.
So I have:
Dim currentquery As String
Dim DB As Database
Dim rec As Recordset
currentquery = "Qry_CheckQuarterEnd"
Set DB = CurrentDb()
Set rec = DB.OpenRecordset(currentquery)
If rec.EOF = True Then
MsgBox "Empty"
Else
rec.MoveLast
MsgBox rec.RecordCount
End If
rec.Close
However, when I try to run this I get the error:
Run Time error 3061
Too few parameters. Expected 1.
Can anyone tell me why I am getting this error.
Many thanks in advance
JP
I am having a problem with a very simple piece of work. I cannot ever remeber there being an issue with this before.
I have a form which has a textfield which has a date in it.
I have a Select query that selects from a simple table all records that match the date that is in the textfield.
In my code, I want to open this query to see if there are any records.
So I have:
Dim currentquery As String
Dim DB As Database
Dim rec As Recordset
currentquery = "Qry_CheckQuarterEnd"
Set DB = CurrentDb()
Set rec = DB.OpenRecordset(currentquery)
If rec.EOF = True Then
MsgBox "Empty"
Else
rec.MoveLast
MsgBox rec.RecordCount
End If
rec.Close
However, when I try to run this I get the error:
Run Time error 3061
Too few parameters. Expected 1.
Can anyone tell me why I am getting this error.
Many thanks in advance
JP