จำได้ว่าเคยทำแล้วค่าไม่ตรงเวลาเลื่อนหน้ารายงานไปหน้าถัดไป ผมเขียนรับค่าแล้วเอาไปใส่อีกหน้าครับ
ผมก็อธิบายไม่ถูก เขียนแล้วก็ debug ค่ามาดู ทำไปเรื่อย ลองอ่านดูนะครับ
Option Compare Database
Dim x As Double
Dim X2 As Double
Dim P1(100)
Dim P2(100)
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If IsNull(Me.Text4.Value) = True Then
Me.Text59.ForeColor = RGB(255, 255, 255)
End If
Me.Text84.Value = " ลำดับที่ในหนังสือรับรองฯ "
End Sub
Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
Me!PageSum = Me!RunSum - x
x = Me!RunSum
Me!PageSum3 = Me!RunSum3 - X2
X2 = Me!RunSum3
P1(Page) = RunSum
P2(Page) = RunSum3
End Sub
Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Dim P As Double
If Forms!menu!FrameA.Value = 1 Then
Me.lblFac.Caption = "สาขาเลขที่... " & Forms!menu!Fac.Column(0) & "....." & Forms!menu!Fac.Column(1) & "...."
End If
Me.txtP1 = P1(Page - 1)
Me.txtP2 = P2(Page - 1)
End Sub
Private Sub Report_NoData(Cancel As Integer)
MsgBox "Nodata "
Cancel = True
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
' Me.rptlblRptCode.Caption = Forms!menu!reportcode.Column(1)
Me.Text65.Value = "ยอดยกมา"
x = 0
X2 = 0
End Sub