⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmshcheng.frm

📁 金融机构用于银行承兑票台帐的登记以及统计打印各种报表
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmshcheng 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "生成报告表"
   ClientHeight    =   3435
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5100
   Icon            =   "frmshcheng.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3435
   ScaleWidth      =   5100
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   840
      Top             =   3000
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   375
      Left            =   3840
      TabIndex        =   8
      Top             =   2880
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   375
      Left            =   2400
      TabIndex        =   7
      Top             =   2880
      Width           =   975
   End
   Begin VB.Frame Frame2 
      Caption         =   "选择"
      Height          =   2415
      Left            =   2040
      TabIndex        =   2
      Top             =   240
      Width           =   2775
      Begin VB.OptionButton Option1 
         Caption         =   "打印预览"
         Height          =   375
         Index           =   3
         Left            =   720
         TabIndex        =   6
         Top             =   1800
         Width           =   1575
      End
      Begin VB.OptionButton Option1 
         Caption         =   "打印并结转下年"
         Height          =   375
         Index           =   2
         Left            =   720
         TabIndex        =   5
         Top             =   1320
         Width           =   1575
      End
      Begin VB.OptionButton Option1 
         Caption         =   "结转下年"
         Height          =   375
         Index           =   1
         Left            =   720
         TabIndex        =   4
         Top             =   840
         Width           =   1575
      End
      Begin VB.OptionButton Option1 
         Caption         =   "打印报表"
         Height          =   375
         Index           =   0
         Left            =   720
         TabIndex        =   3
         Top             =   360
         Width           =   1575
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "说明"
      Height          =   2415
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1575
      Begin VB.Label Label1 
         Caption         =   "2001-12-12至2002-11-11的承兑申请人报告表已经生成,请选择下一步要进行的操作。"
         Height          =   1695
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1215
      End
   End
End
Attribute VB_Name = "frmshcheng"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Base 1
Dim Cdsqr() As String '定义承兑申请人
Dim Cdsqrye() As Double  '定义承兑申请人余额
Dim Cd1() As Double  '定义期初额、期到期额、期新增额、期余额(期指年初至到期日期)\本期到期额、本期新增额、本期初额
Dim Cd2() As Double
Dim Cd3() As Double
Dim Cd4() As Double
Dim Cd5() As Double
Dim Cd6() As Double
Dim Cd7() As Double

Dim Size As Integer '定义承兑申请人数量
Dim Qcrq3 As String '定义年初日期、本期初日期、本期未日期
Dim Qcrq2 As String
Dim Qcrq1 As String
Dim Niandu As Integer '定义下年所在年度

Private Sub Command1_Click()

Unload Me
End Sub

Private Sub Command2_Click()
If Option1(0).Value = True Then
Screen.MousePointer = 11
'On Error GoTo errorhandler  '如果设置出现错误则可以手工设置
'Set obj = New PrinterControl '设置打印方向为横向
'obj.ChngOrientationLandscape
'X = SetDefaultPrinterOrientation(OrientLandscape)  '设置纸张大小为A4
'errorhandler:: Printer.EndDoc
'If Printer.Orientation = 1 Or Printer.PaperSize <> 9 Then
'MsgBox "需首先对默认打印机进行设置," & Chr$(13) & "请设方向为横向、纸张大小为A4。", vbOKOnly Or vbExclamation, "系统信息"
'Screen.MousePointer = 0
'GoTo bbb
'End If
'ccc:
On Error GoTo ExitSub
Me.CommonDialog1.ShowPrinter
Unload 承兑申请人情况报告表
Unload DataEnvironment1
DataEnvironment1.Connection1.Open "data.mdb"
With 承兑申请人情况报告表
.Sections(2).Controls(7).Caption = "(" & Cddate1 & "至" & Cddate2 & ")"
.LeftMargin = Bj(3) * 56.7
.RightMargin = Bj(4) * 56.7
.TopMargin = Bj(1) * 56.7
.BottomMargin = Bj(2) * 56.7
Screen.MousePointer = 0
.PrintReport
End With
'Exit Sub
'bbb:
'On Error GoTo ExitSub
'CommonDialog1.Flags = cdlPDPrintSetup
'CommonDialog1.ShowPrinter
'GoTo ccc
ExitSub:
Screen.MousePointer = 0
'obj.ReSetOrientation '恢复打印机打印方向
ElseIf Option1(1).Value = True Then
Screen.MousePointer = 11
With ycdck.Adodc1
.RecordSource = "select 承兑申请人 from 承兑申请人"
.Refresh
Size = .Recordset.RecordCount
ReDim Cdsqr(Size)
For i = 1 To Size   '求承兑申请人
Cdsqr(i) = .Recordset.Fields(0).Value
.Recordset.MoveNext
Next i
ReDim Cdsqrye(Size)
For i = 1 To Size
.RecordSource = "select 本期余额 from 承兑申请人报告表 where 承兑申请人=" & "'" & Cdsqr(i) & "'"
.Refresh
Cdsqrye(i) = .Recordset.Fields(0).Value
Next i
'Niandu = Val(Left$(Cddate2, 4)) + 1

Niandu = Year(Cddate2) + 1
MsgBox Niandu
.Recordset.Close
.Recordset.Open "delete * from 承兑申请人年初余额 where 年度=" & Niandu
.Refresh
For i = 1 To Size
.RecordSource = "select * from 承兑申请人年初余额 where 年度=" & Niandu & " and 承兑申请人=" & "'" & Cdsqr(i) & "'"
.Refresh
.Recordset.AddNew
.Recordset.Fields(1).Value = Cdsqr(i)
.Recordset.Fields(2).Value = Niandu
.Recordset.Fields(3).Value = Cdsqrye(i)
.Recordset.Update
Next i
Screen.MousePointer = 0
MsgBox "数据结转成功!", vbOKOnly Or vbInformation, "系统信息"
End With
ElseIf Option1(2).Value = True Then
Screen.MousePointer = 11
With ycdck.Adodc1
.RecordSource = "select 承兑申请人 from 承兑申请人"
.Refresh
Size = .Recordset.RecordCount
ReDim Cdsqr(Size)
For i = 1 To Size   '求承兑申请人
Cdsqr(i) = .Recordset.Fields(0).Value
.Recordset.MoveNext
Next i
ReDim Cdsqrye(Size)
For i = 1 To Size
.RecordSource = "select 本期余额 from 承兑申请人报告表 where 承兑申请人=" & "'" & Cdsqr(i) & "'"
.Refresh
Cdsqrye(i) = .Recordset.Fields(0).Value
Next i
'Niandu = Val(Left$(Cddate2, 4)) + 1
Niandu = Year(Cddate2) + 1

.Recordset.Close
.Recordset.Open "delete * from 承兑申请人年初余额 where 年度=" & Niandu
.Refresh
For i = 1 To Size
.RecordSource = "select * from 承兑申请人年初余额 where 年度=" & Niandu & " and 承兑申请人=" & "'" & Cdsqr(i) & "'"
.Refresh
.Recordset.AddNew
.Recordset.Fields(1).Value = Cdsqr(i)
.Recordset.Fields(2).Value = Niandu
.Recordset.Fields(3).Value = Cdsqrye(i)
.Recordset.Update
Next i
Screen.MousePointer = 0
MsgBox "数据结转成功!开始打印报表。", vbOKOnly Or vbInformation, "系统信息"
End With
Screen.MousePointer = 11
'On Error GoTo errorhandler5  '如果设置出现错误则可以手工设置
'Set obj = New PrinterControl '设置打印方向为横向
'obj.ChngOrientationLandscape
'X = SetDefaultPrinterOrientation(OrientLandscape)  '设置纸张大小为A4
'errorhandler5:: Printer.EndDoc
'If Printer.Orientation = 1 Or Printer.PaperSize <> 9 Then
'MsgBox "需首先对默认打印机进行设置," & Chr$(13) & "请设方向为横向、纸张大小为A4。", vbOKOnly Or vbExclamation, "系统信息"
'Screen.MousePointer = 0
'GoTo bbb1
'End If
'ccc1:
On Error GoTo Exitsub1
Me.CommonDialog1.ShowPrinter
Unload 承兑申请人情况报告表
Unload DataEnvironment1
DataEnvironment1.Connection1.Open "data.mdb"
With 承兑申请人情况报告表
.Sections(2).Controls(7).Caption = "(" & Cddate1 & "至" & Cddate2 & ")"
.LeftMargin = Bj(3) * 56.7
.RightMargin = Bj(4) * 56.7
.TopMargin = Bj(1) * 56.7
.BottomMargin = Bj(2) * 56.7
Screen.MousePointer = 0
.PrintReport
End With
'Exit Sub
'bbb1:
'On Error GoTo Exitsub1
'CommonDialog1.Flags = cdlPDPrintSetup
'CommonDialog1.ShowPrinter
'GoTo ccc1
Exitsub1:
Screen.MousePointer = 0
'obj.ReSetOrientation '恢复打印机打印方向
ElseIf Option1(3).Value = True Then
Screen.MousePointer = 11
'On Error GoTo errorhandler3  '如果设置出现错误则可以手工设置
'Set obj = New PrinterControl '设置打印方向为横向
'obj.ChngOrientationLandscape
'X = SetDefaultPrinterOrientation(OrientLandscape)  '设置纸张大小为A4
'errorhandler3:: Printer.EndDoc
'If Printer.Orientation = 1 Or Printer.PaperSize <> 9 Then
'MsgBox "需首先对默认打印机进行设置," & Chr$(13) & "请设方向为横向、纸张大小为A4。", vbOKOnly Or vbExclamation, "系统信息"
'Screen.MousePointer = 0
'GoTo bbb3
'End If
'ccc3:
On Error GoTo Exitsub3
Me.CommonDialog1.ShowPrinter
Unload 承兑申请人情况报告表
Unload DataEnvironment1
DataEnvironment1.Connection1.Open "data.mdb"
'打开关闭结束
With 承兑申请人情况报告表
.Sections(2).Controls(7).Caption = "(" & Cddate1 & "至" & Cddate2 & ")"
.LeftMargin = Bj(3) * 56.7
.RightMargin = Bj(4) * 56.7
.TopMargin = Bj(1) * 56.7
.BottomMargin = Bj(2) * 56.7
Screen.MousePointer = 0
.Show 1
End With
'Exit Sub
'bbb3:
'On Error GoTo Exitsub3
'CommonDialog1.Flags = cdlPDPrintSetup
'CommonDialog1.ShowPrinter
'GoTo ccc3
Exitsub3:
Screen.MousePointer = 0
'obj.ReSetOrientation '恢复打印机打印方向
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
With ycdck.Adodc1
.RecordSource = "select * from 承兑申请人报告表"
.Refresh
.Recordset.Close
.Recordset.Open "delete * from 承兑申请人报告表"
.Refresh
End With
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -