Help with looping a dynamic sql string
i am trying to run the following and was wandering what part of sytax i am
missing in order for the loop to work properly
SQL = " Insert Into tblCLTestQs "
SQL = SQL & "( "
for Loopenit = 1 to NumberOFQs step 1
SQL = SQL & " Q" & Loopenit & ", "
next
SQL = SQL & " TestID) "
SQL = SQL & " Values ( "
for Addenit = 1 to 50 step 1
SQL = SQL & " '" & memQ & Addenit & "', "
next
Re: Help with looping a dynamic sql string
"jeff" <jsymsy1@comcast.net> wrote:
>
>i am trying to run the following and was wandering what part of sytax i
am
>missing in order for the loop to work properly
>
>SQL = " Insert Into tblCLTestQs "
> SQL = SQL & "( "
> for Loopenit = 1 to NumberOFQs step 1
> SQL = SQL & " Q" & Loopenit & ", "
> next
> SQL = SQL & " TestID) "
> SQL = SQL & " Values ( "
> for Addenit = 1 to 50 step 1
> SQL = SQL & " '" & memQ & Addenit & "', "
> next
The only syntax error I can see is a missing ) at the end of your statement.