lewin85_sg
asked on
double quotes "
i've been getting a Missing operand before '&' operator error.
my code needs to be for example :
dv.RowFilter = "name LIKE '*david*'"
right now i'm trying to pass two variables i got from a form into that statement:
dim searchfrm = Request.Form("searchfrm")
dim searchval = Request.Form("searchval")
searchstr = """ + searchfrm + " " + "LIKE" + " " + "'*" + searchval + "*'" + """
dv.RowFilter = searchstr
However, this does not work.. I get the Missing operand before '&' operator error.
I tried Response.Write(searchstr), it displays the statement i want correctly but why wouldn't it work as a complete statement??
please help!! really urgent
my code needs to be for example :
dv.RowFilter = "name LIKE '*david*'"
right now i'm trying to pass two variables i got from a form into that statement:
dim searchfrm = Request.Form("searchfrm")
dim searchval = Request.Form("searchval")
searchstr = """ + searchfrm + " " + "LIKE" + " " + "'*" + searchval + "*'" + """
dv.RowFilter = searchstr
However, this does not work.. I get the Missing operand before '&' operator error.
I tried Response.Write(searchstr),
please help!! really urgent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you^^ that worked
dv.RowFilter = searchstr
Instead of " try chr(34)
Example:
searchstr = chr(34) & searchfrm & " LIKE " & "'*" & searchval & "*'" & chr(34)
dv.RowFilter = searchstr
And i'm not sure about the *
Better would be:
searchstr = chr(34) & searchfrm & " LIKE " & "'%" & searchval & "%'" & chr(34)
dv.RowFilter = searchstr
I've never seen this RowFilter function before, so this may not help.