i am not getting the information from the recordset when more than one checkbox is ticked. Could someone please advise,
Thankyou
Function IsChecked(check)
Dim nChecked
If (check<> " ") Then
nChecked = True
Else
nChecked = False
End If
IsChecked = nChecked
End Function
If request("submit")="SUBMIT" then
'declarationiof variables
Dim i, check, myArray, where_clause
'obtaining values from form
check = Request("checkbox")
myArray = Split(check,", ")
where_clause = " "
For i = 0 To UBound(myArray)
if(IsChecked(check) = True) then
if i > 0 then
where_clause = "acct_code = " &"'"&myArray(i)&"'"& " "&"AND"& " "&where_clause
else
where_clause = "acct_code = " &"'"&myArray(i)&"'"
'response.write(myArray(i))
end if
else
if check = "" then
Response.Write(" was NOT checked<br>")
end if
'response.write(where_clause & "<br>")
end if
Next
qry = "Select name, email, phone, fax, acct_code from acctstable WHERE "& where_clause &""
response.Write(qry)
Set oRs= server.CreateObject("adodb.recordset")
dim pagenum, page
'pagecnt=oRs.PageCount
oRs.Pagesize=50
oRs.CursorLocation = 3
'oRs.Locktype = 3
oRs.CursorType = 3
oRs.open qry, oConn, 3, 3


Reply With Quote



Bookmarks