I have 3 things being passed from a form. All need to be checked. The code works if all are left alone, basically set to none. If they aren't it whines. I know it's something simple to do with the syntax but I can't see it.
thanks
Code:
curhs = Request.Form("schoolis")
appfine = Request.Form("fneedis")
appneed = Request.Form("needis")
If curhs <> "anyschool" then
strSQL1 = "SELECT * FROM dbo.PCGA WHERE dbo.PCGa.curhs = " & curhs
ElseIf curhs = "anyschool" then
strSQL1 = "SELECT * FROM dbo.PCGa WHERE"
End If
If appfine <> "Any" and curhs = "anyschool" then
strSQL2 = strSQL1 + " dbo.PCGa.appfine = " & appfine
ElseIf appfine <> "any" and curhs <> "anyschool" then
strSQL2 = strSQL1 + " & dbo.PCGa.appfine = " & appfine
ElseIf appfine = "Any" then
strSQL2 = strSQL1
End If
If appneed <> "Any" and curhs = "anyschool" and appfine = "Any" then
strSQL = strSQL2 + " dbo.PCGa.appneed = " & appneed
ElseIf appneed <> "Any" and curhs <> "anyschool" or appfine <> "Any" then
strSQL = strSQL2 + " & dbo.PCGa.appneed = " & appneed
ElseIf appneed = "Any" then
strSQL = strSQL2
Elseif appneed = "Any" and curhs = "anyschool" and appfine = "Any" then
strSQL = "SELECT * FROM dbo.PCGa"
End If
thanks