Certainly there has to be an easier way than this! Can anyone help? I have several lists that need to be pasted into a single form variable with a comma in between. Right now with only four lists, I made a series of "if else" statements to try to cover all combinations but I want to add more lists which will be too much to do it this way. It works now but it's a mess. Thanks to anyone who has a better way to do it that an obviously non-programmer such as myself can do!
Don
[tt]
IF (request.form("ALL" = "0" then
CITY0 = "'Cupertino','Los Altos','Los Altos Hills','Mountain View','Palo Alto','Stanford','Sunnyvale','Campbell','Milpitas','Santa Clara','Los Gatos','San Jose','Monte Sereno','Saratoga','Gilroy','San Martin','Morgan Hill'"
ELSE
IF (request.form("NORTH" = "1" then
CITY1 = "'Cupertino','Los Altos','Los Altos Hills','Mountain View','Palo Alto','Stanford','Sunnyvale'"
END IF
IF (request.form("CENTRAL" = "2" then
CITY2 = "'Campbell','Milpitas','Santa Clara','Los Gatos','San Jose','Monte Sereno','Saratoga'"
END IF
IF (request.form("SOUTH" = "3" then
CITY3 = "'Gilroy','San Martin','Morgan Hill'"
END IF
END IF
IF CITY0 <> "" then
CITY = CITY0
ELSE
IF CITY1 <> "" AND CITY2 <> "" then
CITY = (CITY1 & "," & CITY2)
ELSE
IF CITY1 <> "" AND CITY3 <> "" then
CITY = (CITY1 & "," & CITY3)
ELSE
IF CITY2 <> "" AND CITY3 <> "" then
CITY = (CITY2 & "," & CITY3)
ELSE
IF CITY1 <> "" then
CITY = CITY1
ELSE
IF CITY2 <> "" then
CITY = CITY2
ELSE
IF CITY3 <> "" then
CITY = CITY3
ELSE
IF CITY1 <> "" & CITY2 <> "" & CITY3 <> "" then
CITY = (CITY1 & "," & CITY2 & "," & CITY3)
ELSE
CITY=Request.Form("CITY"
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
[/tt]
Don
[tt]
IF (request.form("ALL" = "0" then
CITY0 = "'Cupertino','Los Altos','Los Altos Hills','Mountain View','Palo Alto','Stanford','Sunnyvale','Campbell','Milpitas','Santa Clara','Los Gatos','San Jose','Monte Sereno','Saratoga','Gilroy','San Martin','Morgan Hill'"
ELSE
IF (request.form("NORTH" = "1" then
CITY1 = "'Cupertino','Los Altos','Los Altos Hills','Mountain View','Palo Alto','Stanford','Sunnyvale'"
END IF
IF (request.form("CENTRAL" = "2" then
CITY2 = "'Campbell','Milpitas','Santa Clara','Los Gatos','San Jose','Monte Sereno','Saratoga'"
END IF
IF (request.form("SOUTH" = "3" then
CITY3 = "'Gilroy','San Martin','Morgan Hill'"
END IF
END IF
IF CITY0 <> "" then
CITY = CITY0
ELSE
IF CITY1 <> "" AND CITY2 <> "" then
CITY = (CITY1 & "," & CITY2)
ELSE
IF CITY1 <> "" AND CITY3 <> "" then
CITY = (CITY1 & "," & CITY3)
ELSE
IF CITY2 <> "" AND CITY3 <> "" then
CITY = (CITY2 & "," & CITY3)
ELSE
IF CITY1 <> "" then
CITY = CITY1
ELSE
IF CITY2 <> "" then
CITY = CITY2
ELSE
IF CITY3 <> "" then
CITY = CITY3
ELSE
IF CITY1 <> "" & CITY2 <> "" & CITY3 <> "" then
CITY = (CITY1 & "," & CITY2 & "," & CITY3)
ELSE
CITY=Request.Form("CITY"
END IF
END IF
END IF
END IF
END IF
END IF
END IF
END IF
[/tt]