I am trying to construct a string that I need to use in my if..else statment as:
aryState = array("NY","CA","FL")
if ubound(aryState) = 0 then
strNull = "(isnull(rs(1)) or rs(1) = 0)"
elseif ubound(aryState) = 1 then
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0)"
elseif ubound(aryState) = 2 then
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0) and (isnull(rs(3)) or rs(3) = 0)"
....
end if
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0) and (isnull(rs(3)) or rs(3) = 0)"
if strNull then
...do something
else
...do something else
end if
and is getting syntax error.
This is just a simple example, I set my strNull variable using a for..next loop because my aryState varies from 1 to 50 elements.
Is this possible? is there any way to get around it>?
Any help will be greatly appreciated.
aryState = array("NY","CA","FL")
if ubound(aryState) = 0 then
strNull = "(isnull(rs(1)) or rs(1) = 0)"
elseif ubound(aryState) = 1 then
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0)"
elseif ubound(aryState) = 2 then
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0) and (isnull(rs(3)) or rs(3) = 0)"
....
end if
strNull = "(isnull(rs(1)) or rs(1) = 0) and (isnull(rs(2)) or rs(2) = 0) and (isnull(rs(3)) or rs(3) = 0)"
if strNull then
...do something
else
...do something else
end if
and is getting syntax error.
This is just a simple example, I set my strNull variable using a for..next loop because my aryState varies from 1 to 50 elements.
Is this possible? is there any way to get around it>?
Any help will be greatly appreciated.