Ciao a tutti.....Vi lancio una chicca....su un sito ho trovato come stampare una fattura
con un report di access...solo che a me non funziona.
Vi posto le routine.....poi vi faccio la domanda.
Option Compare Database
Option Explicit
Dim RigheStampate As Integer 'Conta le righe stampate
Dim RigheTotali As Integer 'Righe da stampare in totale (vengono conteggiate all'inizio)
Dim PagineTotali As Integer 'Pagine da stampare (vengono calcolate all 'inizio)
Dim PagineStampate As Integer 'Conta le pagine stampate
Const RighePerPagina = 20 'Righe da stampare in ogni pagina
Const RigheFinali = 6 'Righe occupate dal pie' di pagina di gruppo
Private Sub Corpo_Print(Cancel As Integer, PrintCount As Integer)
Dim ctl As Control
RigheStampate = RigheStampate + 1
If PagineStampate < PagineTotali Then
If RigheStampate >= RighePerPagina Then
If RigheStampate > RighePerPagina Then
RigheVisibili False
End If
If RigheStampate < ((RighePerPagina + RigheFinali) * PagineStampate) Then
Me.NextRecord = False
End If
End If
Else
If RigheStampate >= RigheTotali + (PagineTotali - 1) * RigheFinali Then
If RigheStampate > RigheTotali + (PagineTotali - 1) * RigheFinali Then
RigheVisibili False
End If
If RigheStampate < RighePerPagina * PagineStampate + (PagineTotali - 1) * RigheFinali Then
Me.NextRecord = False
End If
End If
End If
End Sub
Private Sub IntestazioneGruppo0_Print(Cancel As Integer, PrintCount As Integer)
RigheTotali = DCount("idfatturerighe", "T_fatturerighe", "idfattura ='" & Me.IdFattura & "'")
PagineTotali = Int(RigheTotali / RighePerPagina) + IIf((RigheTotali Mod RighePerPagina) > 0, 1, 0)
PagineStampate = PagineStampate + 1
RigheVisibili True
End Sub
Private Sub PičDiPaginaGruppo1_Print(Cancel As Integer, PrintCount As Integer)
RigheStampate = 0
PagineStampate = 0
PagineTotali = 0
End Sub
Private Function RigheVisibili(fVisibili As Boolean)
Dim ctl As Control
For Each ctl In Me.Corpo.Controls
ctl.Visible = fVisibili
Next ctl
End Function
------------------------------------
Quello che non capisco č se la dim RigheStampate, RigheTotali, PagineTotali,
PagineStampate, RighePerPagina etc. sono dei campi da inserire nel report o meno.
Se qualcuno oltre a capire e quindi a far sua queste routines
mi sā spiegare anche a me quello che devo fare, gli sarō debitore per
sempre!!!!!!!
Grazie