This is a code that I have, and it is giving me an error
(Invalid use of property)Dim Temp As String

Dim Temp as String
Dim rst As Recordset
Dim db As Database

Temp = txtYear3
Set db = OpenDatabase("c:\report card\temposchool.mdb")
Set rst = db.OpenRecordset("Grades", dbOpenSnapshot)

If rst.EOF = False Then

rst.Filter "StudentNam ='temp'"

End If


NOTE: txtYear3 is a text Box
StudentNam as a field in the table
table Grades

Can you what is wrong, please help

Thanks