📄 form4.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Begin VB.Form Form4
Caption = "报表打印中心"
ClientHeight = 5385
ClientLeft = 60
ClientTop = 345
ClientWidth = 7905
Icon = "Form4.frx":0000
LinkTopic = "Form4"
ScaleHeight = 5385
ScaleWidth = 7905
StartUpPosition = 3 '窗口缺省
Begin StoneXP.XPFrame XPFrame1
Height = 3135
Left = 600
TabIndex = 3
Top = 1800
Width = 6735
_ExtentX = 11880
_ExtentY = 5530
Caption = "自定义输出报表"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BackColor = 16777152
LeftSpace = 0
RightSpace = 0
RoundSize = 5
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty DataFormat
Type = 1
Format = "yyyy-M-d"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 270
Left = 3720
TabIndex = 8
Top = 1072
Width = 1575
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty DataFormat
Type = 1
Format = "yyyy-M-d"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 270
Left = 1800
TabIndex = 7
Top = 1072
Width = 1575
End
Begin StoneXP.XPButton XPButton4
Height = 375
Left = 2520
TabIndex = 4
Top = 2040
Width = 1335
_ExtentX = 2355
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "输出报表"
MouseIcon = "Form4.frx":000C
MousePointer = 99
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "格式:YYYY-MM-DD"
ForeColor = &H000000FF&
Height = 255
Left = 3240
TabIndex = 9
Top = 1440
Width = 1455
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "至"
Height = 255
Left = 3480
TabIndex = 6
Top = 1080
Width = 255
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "日期:"
Height = 255
Left = 1320
TabIndex = 5
Top = 1080
Width = 495
End
End
Begin StoneXP.XPButton XPButton1
Height = 375
Left = 1560
TabIndex = 0
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "输出日报表"
MouseIcon = "Form4.frx":0326
MousePointer = 99
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 3120
TabIndex = 1
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "输出月报表"
MouseIcon = "Form4.frx":0640
MousePointer = 99
End
Begin StoneXP.XPButton XPButton3
Height = 375
Left = 4680
TabIndex = 2
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "输出年报表"
MouseIcon = "Form4.frx":095A
MousePointer = 99
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Classprint As New OpenRs '定义打印记录集
Private Sub XPButton1_Click()
sql = "select * from 售票记录 where 售票日期='" & Date & "' and 注销='0'"
'定义相对称的SQL语句
Classprint.rsDK1 sql
'将语句拉到类模块中执行
classreport.Show '显示报表
Set classreport.DataSource = Classprint.rs1
'将报表的记录集设定为rs1
End Sub
Private Sub XPButton2_Click()
sql = "select * from 售票记录 where 售票日期 like '" & Year(Date) & "-" & Month(Date) & "%' and 注销='0'"
Classprint.rsDK1 sql
classreport.Show
Set classreport.DataSource = Classprint.rs1
End Sub
Private Sub XPButton3_Click()
sql = "select * from 售票记录 where 售票日期 like '" & Year(Date) & "%' and 注销='0'"
Classprint.rsDK1 sql
classreport.Show
Set classreport.DataSource = Classprint.rs1
End Sub
Private Sub XPButton4_Click()
If Text1.Text <> "" And Text2.Text <> "" Then
sql = "select * from 售票记录 where 售票日期>='" & Text1.Text & "' and 售票日期<='" & Text2.Text & "' and 注销='0'"
Classprint.rsDK1 sql
classreport.Show
Set classreport.DataSource = Classprint.rs1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -