Hi,
Can anyone help me with the following problem: I get the above error message when I try to open a recordset. If I run the query directly it returns a record with no error messages but when I insert it into my code I get the error. Here's the part of my code that seems to give me the problem, can anyone throw any light on what I'm doing wrong?
Set db = CurrentDb()
strQuery = "SELECT Workfile.Period, Workfile.Year FROM Workfile " & _
"GROUP BY Workfile.Period, Workfile.Year " & _
"HAVING Workfile.Period =[Forms]![Main Form]![CmbPeriod] " & _
"AND Workfile.Year=[Forms]![Main Form]![CmbYear];"
Set rst = db.OpenRecordset(strQuery)
Many thanks, in anticipation....
Can anyone help me with the following problem: I get the above error message when I try to open a recordset. If I run the query directly it returns a record with no error messages but when I insert it into my code I get the error. Here's the part of my code that seems to give me the problem, can anyone throw any light on what I'm doing wrong?
Set db = CurrentDb()
strQuery = "SELECT Workfile.Period, Workfile.Year FROM Workfile " & _
"GROUP BY Workfile.Period, Workfile.Year " & _
"HAVING Workfile.Period =[Forms]![Main Form]![CmbPeriod] " & _
"AND Workfile.Year=[Forms]![Main Form]![CmbYear];"
Set rst = db.OpenRecordset(strQuery)
Many thanks, in anticipation....