📄 frmbbzh.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form FrmBBZH
BackColor = &H80000018&
BorderStyle = 1 'Fixed Single
Caption = "报表组合"
ClientHeight = 6600
ClientLeft = 45
ClientTop = 330
ClientWidth = 8610
Icon = "FrmBBZH.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6600
ScaleWidth = 8610
StartUpPosition = 1 'CenterOwner
Begin VB.Frame Frame1
BackColor = &H80000018&
Caption = "报表组合"
Height = 765
Left = 330
TabIndex = 0
Top = 570
Width = 7935
Begin VB.ComboBox cmbBBZH
Height = 315
Left = 810
Style = 2 'Dropdown List
TabIndex = 4
Top = 300
Width = 3435
End
Begin XPControls.XPCommandButton cmdDelete
Height = 405
Left = 6750
TabIndex = 1
Top = 225
Width = 945
_ExtentX = 1667
_ExtentY = 714
Enabled = 0 'False
Caption = "删除(&D)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdModify
Height = 405
Left = 5670
TabIndex = 2
Top = 225
Width = 945
_ExtentX = 1667
_ExtentY = 714
Enabled = 0 'False
Caption = "修改(&M)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdAdd
Height = 405
Left = 4590
TabIndex = 3
Top = 225
Width = 945
_ExtentX = 1667
_ExtentY = 714
Caption = "添加(&A)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "名称:"
Height = 255
Left = 180
TabIndex = 12
Top = 330
Width = 615
End
End
Begin MSComctlLib.ListView lvwAll
DragIcon = "FrmBBZH.frx":0CCA
Height = 4125
Left = 4680
TabIndex = 5
Top = 1710
Width = 3600
_ExtentX = 6350
_ExtentY = 7276
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 1
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "报表名称"
Object.Width = 6068
EndProperty
End
Begin XPControls.XPCommandButton cmdOK
Cancel = -1 'True
Height = 465
Left = 3675
TabIndex = 6
Top = 6000
Width = 1275
_ExtentX = 2249
_ExtentY = 820
Caption = "确定(&O)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdAddReport
Height = 345
Left = 4020
TabIndex = 7
Top = 3330
Width = 585
_ExtentX = 1032
_ExtentY = 609
Caption = "<"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdDeleteReport
Height = 345
Left = 4020
TabIndex = 8
Top = 3990
Width = 585
_ExtentX = 1032
_ExtentY = 609
Caption = ">"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSComctlLib.ListView lvwReport
DragIcon = "FrmBBZH.frx":0E1C
Height = 4125
Left = 330
TabIndex = 9
Top = 1710
Width = 3600
_ExtentX = 6350
_ExtentY = 7276
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 1
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "报表名称"
Object.Width = 6068
EndProperty
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "报表组合可以让您一次打印成批的报表"
Height = 195
Left = 180
TabIndex = 13
Top = 210
Width = 3060
End
Begin VB.Label lblTitle
BackStyle = 0 'Transparent
Caption = "报表列表:"
Height = 255
Left = 330
TabIndex = 11
Top = 1410
Width = 975
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "可选择报表:"
Height = 195
Left = 4650
TabIndex = 10
Top = 1410
Width = 1080
End
End
Attribute VB_Name = "FrmBBZH"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mstrZHID As String
Private Sub cmbBBZH_Click()
On Error GoTo ErrMsg
Dim Status
Dim strSQL As String
Dim rsReport As ADODB.Recordset
Dim i As Integer
Me.MousePointer = vbHourglass
lvwReport.ListItems.Clear
lvwAll.ListItems.Clear
'查看用户是否有选择
If cmbBBZH.Text = "" Then
cmdModify.Enabled = False
cmdDelete.Enabled = False
cmdAddReport.Enabled = False
cmdDeleteReport.Enabled = False
lblTitle.Caption = "报表列表:"
GoTo ExitLab
Else
cmdModify.Enabled = True
cmdDelete.Enabled = True
cmdAddReport.Enabled = True
cmdDeleteReport.Enabled = True
End If
'如果有选择,则获取当前选择报表组合的ID号
mstrZHID = LongToString(cmbBBZH.ItemData(cmbBBZH.ListIndex), 5)
lblTitle.Caption = cmbBBZH.Text & " 包含的报表列表:"
lblTitle.AutoSize = True
'获取当前报表组合所包含的报表
strSQL = "select REPORT_ZHDT.BBID,BBMC" _
& " from REPORT_ZHDT,REPORT_MC" _
& " where REPORT_ZHDT.BBID=REPORT_MC.BBID" _
& " and REPORT_ZHDT.ZHID='" & mstrZHID & "'" _
& " order by SXH"
Set rsReport = New ADODB.Recordset
rsReport.Open strSQL, GCon, adOpenStatic, adLockOptimistic
If Not rsReport.EOF Then
rsReport.MoveFirst
Do
lvwReport.ListItems.Add , "W" & rsReport("BBID"), rsReport("BBMC")
rsReport.MoveNext
Loop Until rsReport.EOF
rsReport.Close
End If
'把剩下的报表显示在右侧的列表中
strSQL = "select * from REPORT_MC" _
& " where BBID not in (" _
& "select BBID from REPORT_ZHDT" _
& " where ZHID='" & mstrZHID & "')"
Set rsReport = New ADODB.Recordset
rsReport.Open strSQL, GCon, adOpenStatic, adLockOptimistic
If Not rsReport.EOF Then
rsReport.MoveFirst
Do
lvwAll.ListItems.Add , "W" & rsReport("BBID"), rsReport("BBMC")
rsReport.MoveNext
Loop Until rsReport.EOF
rsReport.Close
End If
Set rsReport = Nothing
GoTo ExitLab
ErrMsg:
Status = SetError(Err.Number, Err.Description, Err.Source)
ErrMsg Status
ExitLab:
Me.MousePointer = vbDefault
End Sub
Private Sub cmdAdd_Click()
On Error GoTo ErrMsg
Dim Status
Dim strSQL As String
Dim rsReport As ADODB.Recordset
Dim cmd As ADODB.Command
Dim strZHMC As String
Dim strMaxID As String
Dim i As Integer
Me.MousePointer = vbHourglass
'***********************************************************
'版本控制
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -