I have a code that looks like this:
Dim db As Database
Dim rs As Recordset
Dim StrsQL As String
Dim SvAr As String
Set db = CurrentDb
SvAr ="A" 'not really "A", actually a value from control, but for ease of explanation I use "A"
StrsQL = "SELECT * From [Table1] Where ([Category] = (SvAr))"
Set rs = db.OpenRecordset(StrsQL, dbOpenSnapshot)
.... some mor e code follows.
Now, why isn't this SqL statement working?
It gives the error message "RunTime error 3061, too few Parameters. Expected 1."
Please help.
Ramon
Dim db As Database
Dim rs As Recordset
Dim StrsQL As String
Dim SvAr As String
Set db = CurrentDb
SvAr ="A" 'not really "A", actually a value from control, but for ease of explanation I use "A"
StrsQL = "SELECT * From [Table1] Where ([Category] = (SvAr))"
Set rs = db.OpenRecordset(StrsQL, dbOpenSnapshot)
.... some mor e code follows.
Now, why isn't this SqL statement working?
It gives the error message "RunTime error 3061, too few Parameters. Expected 1."
Please help.
Ramon