Hi Im Getting an error when open the secon record set in the below code.
Why is this
Code:
strSQL = "SELECT * FROM "&tabName1&" ORDER BY id"
RS.Open strSQL, Conn
if not rs.bof or not rs.eof then
RS.MoveFirst
do while not RS.EOF
if Cint(sMonth) <> 99 and tabName1="referals" then
strSQL = "SELECT * FROM comments where referal='"&RS("referal")&"' entryMonth="&Cint(sMonth)&" order by id"
end if
if Cint(sMonth) = 99 and tabName1="referals" then
strSQL = "SELECT * FROM comments where referal='"&RS("referal")&"'"&" order by id"
end if
if Cint(sMonth) <> 99 and tabName1="portals" then
strSQL = "SELECT * FROM comments where portal='"&RS("portal")&"' and entryMonth="&Cint(sMonth)&" order by id"
end if
if Cint(sMonth) = 99 and tabName1="portals" then
strSQL = "SELECT * FROM comments where portal='"&RS("portal")&"'"&" order by id"
end if
RS2.Open strSQL, Conn
' process results here namely count of records found
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?