|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
example a table has rows a,b,c and cols 1,2,3. Each row is formed by a loop, but I don't necessarily have values for each cell- the row is determined by one of the fields- (in the example "y" specifies the row) how do I start the loop over in the middle of the loop? specifcally: dbrs.MoveFirst() do while not dbrs.eof dbrs. Move(0) x = dbrs("x") y = dbrs("y") %> <tr> <% if x = "a1" then response.write("<td>" & value1 & "</td>") elseresponse.write("<td></td>") end if dbrs.MoveNext y2 = dbrs("y") if y2 = y1 then 'continue with code else response.write("<td colspan=2></td></tr>") ' ? goto beginning of loop end if %> <td> <% if x = "a2" then response.write("<td>" & value2 & "</td>") response.write("<td></td>")else end if dbrs.MoveNext y2 = dbrs("y") if y2 = y1 then 'continue with code else response.write("<td></td></tr>") ' ? goto beginning of loop end if %> <td> <% if x = "a3" then response.write("<td>" & value3 & "</td>") response.write("<td></td>")else end if %> </tr> <% dbrs.MoveNext loop %> Thanks, Amanda *** Sent via Developersdex http://www.developersdex.com *** Place
dbrs.MoveFirst() where you have > ' ? goto beginning of loop The above will start the loop over. Now if what you wantis to just move on to the next loop item, then you need to nest your IF statements in such a way so that no further code within the loop will be excuted until the next time around. Good luck Saga Show quoteHide quote "Amanda Hallock" <aman***@southwind.org> wrote in message news:Oa0cx8UZFHA.1404@TK2MSFTNGP09.phx.gbl... > I'm trying to make a table with values I pulled from a recordset - for > example a table has rows a,b,c and cols 1,2,3. Each row is formed by > a > loop, but I don't necessarily have values for each cell- the row is > determined by one of the fields- (in the example "y" specifies the > row) > > how do I start the loop over in the middle of the loop? > > specifcally: > dbrs.MoveFirst() > do while not dbrs.eof > dbrs. Move(0) > x = dbrs("x") > y = dbrs("y") > > %> > <tr> > <% if x = "a1" then > response.write("<td>" & value1 & "</td>") > else > response.write("<td></td>") > end if > dbrs.MoveNext > y2 = dbrs("y") > if y2 = y1 then > 'continue with code > else > response.write("<td colspan=2></td></tr>") > ' ? goto beginning of loop > end if > %> > <td> > <% if x = "a2" then > response.write("<td>" & value2 & "</td>") > else > response.write("<td></td>") > end if > dbrs.MoveNext > y2 = dbrs("y") > if y2 = y1 then > 'continue with code > else > response.write("<td></td></tr>") > ' ? goto beginning of loop > end if > %> > <td> > <% if x = "a3" then > response.write("<td>" & value3 & "</td>") > else > response.write("<td></td>") > end if > %> > </tr> > <% > dbrs.MoveNext > loop > %> > > Thanks, Amanda > > > *** Sent via Developersdex http://www.developersdex.com ***
VBclassic petition
Draw line on picture; change width Class_Terminate problem & Run-time error'424': Object required determining a rising\falling trend Creating a Toolbar Search box at bottom of screen Duplicate forms help with passing values from an aspx page? Working application - Now generates error about dll ?? |
|||||||||||||||||||||||