How to draw a line conditionally

  • Thread starter Thread starter Irshad Alam
  • Start date Start date
I

Irshad Alam

I want a line just after the 15th Record. I know the code
to draw the line,

Me.Line (0,0)-(9240,0)

But I dont know how to make conditional, so that it will
draw only and exactly after 15 records.


Please advise
 
Irshad said:
I want a line just after the 15th Record. I know the code
to draw the line,

Me.Line (0,0)-(9240,0)

But I dont know how to make conditional, so that it will
draw only and exactly after 15 records.


You need to have a line counter so your code can determine
when it's processing the 15th record. This is done by
adding a text box (named txtLineCnt) to the detail section.
Set its control source expression to =1 and its RunningSum
property to Over Group (or Over All). Then you can use code
like this:

If Me.txtLineCnt = 15 Then
Me.Line (0,0)-(9240,0)
End If

I still don't believe the 9240 number ;-)
 
Mr. Marshall

Thanks for your advice.

Me.Line(0,0)-(9240,0)

On above 9240 is twips, and it is for the width, as u know
1 inch = 1440.

The method which you mentioned, I applied, problem arises
here is that it draws the line just before the 15th
Record, I want the line just below the 15th record.
Exactly this was my need.

Could you please advise on it, what to do to bring the
line just below the 15 record. I cannot use the 16th
Record, as on 15th record, the page break functions and
the 16th record goes to next page.

I mean to say, I am trying a function conditionally, that
After 15th record, it will draw a line and Pagebreak.

I hope you understood my need.
 
Try:
If Me.txtLineCnt = 15 Then
Me.Line (0,Me.Section(0).Height)-Step(Me.Width,0)
End If
 
Back
Top