Hi guys,
i have the following query in which i want to search for students' Name and address..where the grade is equal to a value entered in a text box..as i do that i also want to check if the recordset is empty.
Dim str As String
Dim db As Database
Dim Result as Recordset
Set db = CurrentDb()
str = "select student.MainContact,student.Add1,student.Add2 FROM student,grades WHERE(grades =forms!search!gr.value)"
Set Result = db.OpenRecordset(str)
If Result.RecordCount > 0 Then....
else ......e.g. msbox "No Matches found!"
when i run this query i get an error saying "Too few parameters. Expected 1"
where am i going wrong?
i have the following query in which i want to search for students' Name and address..where the grade is equal to a value entered in a text box..as i do that i also want to check if the recordset is empty.
Dim str As String
Dim db As Database
Dim Result as Recordset
Set db = CurrentDb()
str = "select student.MainContact,student.Add1,student.Add2 FROM student,grades WHERE(grades =forms!search!gr.value)"
Set Result = db.OpenRecordset(str)
If Result.RecordCount > 0 Then....
else ......e.g. msbox "No Matches found!"
when i run this query i get an error saying "Too few parameters. Expected 1"
where am i going wrong?