I have a relatively simple SELECT query which when run it gives me "Runtime error 91"
strSQL = "SELECT * FROM tblMonthlyHomeExpenses" _
& " WHERE DatePart('m',[dteTransDate]) =" & intMonthNumber & ";"
When I take the same query and run it as SQL it does exactly what I would expect
SELECT * FROM tblMonthlyHomeExpenses WHERE DatePart('m',[dteTransDate]) =3;
Could anyone please explain to me what is going on. Thanks
strSQL = "SELECT * FROM tblMonthlyHomeExpenses" _
& " WHERE DatePart('m',[dteTransDate]) =" & intMonthNumber & ";"
When I take the same query and run it as SQL it does exactly what I would expect
SELECT * FROM tblMonthlyHomeExpenses WHERE DatePart('m',[dteTransDate]) =3;
Could anyone please explain to me what is going on. Thanks