VBA Code Problem

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I am using a function to create additonal blank lines on
my report, in the detail section. Everything works fine
until I use the print preview, then after using the print
preview, i try to print, and all of my detail records are
blank.

Here is the function, and the variable totgrp is using th
count(*) on the report itself.

Function PrintLines(R As Report, Totgrp)
TotCount = TotCount + 1
If TotCount = Totgrp Then
R.NextRecord = False
ElseIf TotCount > Totgrp And TotCount < 15 Then
R.NextRecord = False
R![Text60].Visible = False
R![Text62].Visible = False
R![Text63].Visible = False
R![Text64].Visible = False
R![Expr1000].Visible = False
R![Text67].Visible = False

End If
End Function

So I can print the report if I use a command button and
print, ie skipping the print preview, and everything works
as if it should. Only issue is when I use the print
preview first, all detail lines are blank when report is
printed.
 
My guess, and this is just a gues is that when you are
making the text fields false (probably near or at the end
of the code) they are staying false the next time the code
runs. Try making them true somewhere in the beggining of
the code.
 
As an after thought I would try only making a couple of
the fields false and see if they are the only ones
dissapearing. Hope this helps.
 
Back
Top