Formatting Results - Inserting Code Every 3 or 4 r

Results 1 to 3 of 3

Thread: Formatting Results - Inserting Code Every 3 or 4 r

  1. #1
    Join Date
    Dec 1969
    Posts
    206

    Default Formatting Results - Inserting Code Every 3 or 4 r

    I need to format my result so that there are 3 or 4 results returned and then they move to the next row. I know this can be done by using table with cells repeating and the &#060;/tr&#062;&#060;tr&#062; appearing every 3rd row. How can I do this?<BR><BR>Thanks.<BR><BR>Brandon

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Formatting Results - Inserting Code Every 3 or

    I use a counter, and then when the counter mod X = 0, (where X is the number of rows you&#039re counting) then you&#039re ready to insert your &#060;/tr&#062;&#060;tr&#062; (or whatever)<BR><BR>Dim iCounter<BR>iCounter = 0<BR><BR>Do While Not objRS.EOF<BR><BR>iCounter = iCounter + 1<BR>&#039Display data<BR>if iCounter mod 3 = 0 then<BR>&#039Do whatever (write &#060;tr&#062;&#060;/tr&#062;)<BR>end if<BR><BR>objRS.MoveNext<BR><BR>Loop<BR><BR>That&# 039s all there is to it!<BR><BR>Happy Programming!

  3. #3
    Join Date
    Dec 1969
    Posts
    206

    Default Thanks, Worked Great!

    Thanks for your help.<BR><BR>Brandon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •