printing problem.

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Hi, I seem to have a problem when I try to print a report
with access 97 (french ver). I created a window that
contains 3 buttons => "VIEW", "PRINT" and "CLOSE". When I
click on the "PRINT" button, the report prints out
nicely. When I click on the "VIEW" button, the info. on
the screen is great, the problem lies when I click on the
printer icon at the left top of the page (default icon
from access). When I click on that icon, the info. that
gets printed onto the report is ok, except for my last
column. The last column holds the value of the last piece
of info. at the end of the report.

ex.: price tax total

desk $400 $25 $365
.. $365
.. $365
.. $365
tv $350 $15 $365

Why? Can someone please help! Thanks.

P.S. => My os is windows 95 and the some users are useing
windows XP. The have the same problem as myself and they
have the same problem when they export towards excel or
word.
 
Are you using any code to calculate the right-most values? If so, you might
want to share this code. If not, what is the control source of the
right-most column.
 
Here is the code. The last column is an independent field
whose name is [HeuresTotalDeDurée].

***********************************************************
Private Sub Détail_Print(Cancel As Integer, PrintCount As
Integer)

Dim Virgul As String

Set LeRapport = Me

If IndDurée < UBound(TotalDeDurée) Then IndDurée =
IndDurée + 1

For I = 1 To 8
LaValeur = "Champ" & I
Set Ctrl = LeRapport(LaValeur)

LaValeur = "VarChamp" & I
Set VarCtrl = LeRapport(LaValeur)

If Ctrl.Value > 0 Then VarCtrl.Value = HeureExt
(Ctrl.Value) Else VarCtrl.Value = ""

Next I

' The following should print the right value on the
report. Remember, that when I view the report before
printing, everthing is correct.

[HeuresTotalDeDurée] = HeureExt(TotalDeDurée(IndDurée))

End Sub
***********************************************************
 
It looks like you are building values into an array. You may need to
initialize the array in the On Format event of the Report Header. I
generally avoid all calculations of values in report section events. You can
almost always accomplish the same without the code.

--
Duane Hookom
MS Access MVP


Here is the code. The last column is an independent field
whose name is [HeuresTotalDeDurée].

***********************************************************
Private Sub Détail_Print(Cancel As Integer, PrintCount As
Integer)

Dim Virgul As String

Set LeRapport = Me

If IndDurée < UBound(TotalDeDurée) Then IndDurée =
IndDurée + 1

For I = 1 To 8
LaValeur = "Champ" & I
Set Ctrl = LeRapport(LaValeur)

LaValeur = "VarChamp" & I
Set VarCtrl = LeRapport(LaValeur)

If Ctrl.Value > 0 Then VarCtrl.Value = HeureExt
(Ctrl.Value) Else VarCtrl.Value = ""

Next I

' The following should print the right value on the
report. Remember, that when I view the report before
printing, everthing is correct.

[HeuresTotalDeDurée] = HeureExt(TotalDeDurée(IndDurée))

End Sub
***********************************************************
 
Back
Top