Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to fill blank space in detail section of report

Status
Not open for further replies.

leesanc

Technical User
Aug 25, 2006
10
MY
I'm using a report that is called from a form to produce an invoice.

The detail section's layout is as follows:

LineNo ProdDes1 Qty UnitPrice Amount
ProdDes2
InvLRemarks

DescriptionL2 and InvLRemarks can shirnk when null (which is 80% of the time).

I'm trying to repeat "-" in the place of UnitPrice and Amount starting after the last line in the detail section until before the footer section.

The function is called in the Detail (OnPrint) control

Here's my code (this is so embarrassing):

Function PrintLines(R As Report, TotGrp)
Dim n As Integer
If TotCount < 23 Then
If [ProdDes2] <> "" Then
If [InvLRemarks] <> "" Then
n = 3
Else
n = 2
End If
Else
If [InvLRemarks] <> "" Then
n = 2
Else
n = 1
End If
End If

TotCount = TotCount + n

If TotCount < TotGrp Then
R.NextRecord = True
R![ProdDes].Visible = True
R![InvoiceLNo].Visible = True
R![Qty].Visible = True
R![UoM].Visible = True
R![UnitPrice].Visible = True
R![Amount].Visible = True
R!Text105.Visible = False ' This is where my "-" goes
R!Text104.Visible = False ' This is where my "-" goes

Else
If TotCount = TotGrp Then
R.NextRecord = False
Else
If TotCount > TotGrp And TotCount < 22 Then
R.NextRecord = False
R![ProdDes].Visible = False
R![InvoiceLNo].Visible = False
R![Qty].Visible = False
R![UoM].Visible = False
R![UnitPrice].Visible = False
R![Amount].Visible = False
R!Text105.Visible = True
R!Text104.Visible = True
R!Text105 = "-"
R!Text104 = "-"

End If
End If
End If
End If

It works fine as long as the ProdDes2 and InvLRemarks are null. If they're not null, my "-" would skip lines.

Is there any other way i can repeat the "-", or remove the ProdDes2 and InvLRemarks when repeated?

Please help! I've tried solving it for 3 days now. :`(

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top