bateman wrote:
Hi, I am am trying to write some code to perform a INSERT in SQL
table using a loop. What would be great is a way of dynamically
entering in data in a requaest.form
ie the final code should look something like:
if Request.Form("type1") = "1" then
where the 1 in "type1" is dynamic so the code would look something
like
Request.Form("type" & Rs.("fld_type_id") & ") = "1" then
But not sure how to form this or whether it would work, anyone have
any idea?
Of course it would work. All you need inside the parntheses is a string
containing the name of the variable. How that string is built is irrelevant.
sVar = "type" & Rs.("fld_type_id")
if Request.Form(sVar) = "1" then
Or, if you want to fly by the seat of your pants:
if Request.Form("type" & Rs.("fld_type_id") ) = "1" then
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"