glrptfrm.frm
来自「VB与欧姆龙PLC通过RS-232串口通讯 的上位机程序」· FRM 代码 · 共 184 行
FRM
184 行
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form Glrptfrm
BackColor = &H00F4FFF5&
BorderStyle = 1 'Fixed Single
Caption = "干料报表"
ClientHeight = 9390
ClientLeft = 60
ClientTop = 345
ClientWidth = 13455
Icon = "Glrptfrm.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 9390
ScaleWidth = 13455
StartUpPosition = 2 '屏幕中心
Begin MSDBGrid.DBGrid GLGRID
Bindings = "Glrptfrm.frx":0442
Height = 8430
Left = 0
OleObjectBlob = "Glrptfrm.frx":045F
TabIndex = 3
Top = 555
Width = 13420
End
Begin VB.CommandButton cmdprt
BackColor = &H00C0E0FF&
Caption = "打印(&P)"
Height = 400
Left = 10000
Style = 1 'Graphical
TabIndex = 2
Top = 8970
Width = 1380
End
Begin VB.CommandButton Glcmdclose
BackColor = &H00C0E0FF&
Caption = "关闭(&G)"
Height = 400
Left = 11380
Style = 1 'Graphical
TabIndex = 0
Top = 8970
Width = 1400
End
Begin VB.Data GldatPrimaryRS
Appearance = 0 'Flat
BackColor = &H00F4FFF5&
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 9000
Width = 10000
End
Begin VB.PictureBox Glcrystalrpt
Height = 480
Left = 11880
ScaleHeight = 420
ScaleWidth = 1140
TabIndex = 4
Top = 9480
Width = 1200
End
Begin VB.Label lblglbt
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 1320
TabIndex = 1
Top = 0
Width = 10215
End
End
Attribute VB_Name = "Glrptfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Gltemptime As String, Gltemp As String, glprint As String
Private Sub cmdprt_Click()
If lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料日报表" Then
Glcrystalrpt.ReportFileName = App.Path & "\Report\glr.rpt"
Glcrystalrpt.DiscardSavedData = True
Glcrystalrpt.Action = 1
ElseIf lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料月报表" Then
Glcrystalrpt.ReportFileName = App.Path & "\Report\gly.rpt"
Glcrystalrpt.DiscardSavedData = True
Glcrystalrpt.Action = 1
ElseIf lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料年度报表" Then
Glcrystalrpt.ReportFileName = App.Path & "\Report\gln.rpt"
Glcrystalrpt.DiscardSavedData = True
Glcrystalrpt.Action = 1
ElseIf lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料历史累计数据报表" Then
Glcrystalrpt.ReportFileName = App.Path & "\Report\glhis.rpt"
Glcrystalrpt.DiscardSavedData = True
Glcrystalrpt.Action = 1
Else
Exit Sub
End If
End Sub
Private Sub Form_Load()
If tbl = 1 Then
dbrpt.Execute "delete from glprt"
Gltemp = "select * from Glreport"
glprint = "insert into glprt " & Gltemp & Glcxconcent & " order by 时间 asc"
dbrpt.Execute glprint
GldatPrimaryRS.DatabaseName = App.Path & "\Report\report.mdb"
GldatPrimaryRS.RecordsetType = 1
GldatPrimaryRS.RecordSource = Gltemp + Glcxconcent + " order by 时间 asc"
lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料日报表"
tbl = 0
Glcxconcent = ""
Exit Sub
ElseIf tbl = 2 Then
dbrpt.Execute "delete from glprt"
Gltemp = "select * from Glreport"
glprint = "insert into glprt " & Gltemp & Glcxconcent & " order by 日期,时间 asc"
dbrpt.Execute glprint
GldatPrimaryRS.DatabaseName = App.Path & "\Report\report.mdb"
GldatPrimaryRS.RecordsetType = 1
GldatPrimaryRS.RecordSource = Gltemp + Glcxconcent + " order by 日期,时间 asc"
lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料月报表"
tbl = 0
Glcxconcent = ""
Exit Sub
ElseIf tbl = 3 Then
dbrpt.Execute "delete from glprt"
Gltemp = "select * from Glreport"
glprint = "insert into glprt " & Gltemp & Glcxconcent & " order by 日期,时间 asc"
dbrpt.Execute glprint
GldatPrimaryRS.DatabaseName = App.Path & "\Report\report.mdb"
GldatPrimaryRS.RecordsetType = 1
GldatPrimaryRS.RecordSource = Gltemp + Glcxconcent + " order by 日期,时间 asc"
lblglbt.FontSize = 18
lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料历史累计数据报表"
tbl = 0
Glcxconcent = ""
Exit Sub
ElseIf tbl = 4 Then
dbrpt.Execute "delete from glprt"
Gltemp = "select * from Glreport"
glprint = "insert into glprt " & Gltemp & Glcxconcent & " order by 日期,时间 asc"
dbrpt.Execute glprint
GldatPrimaryRS.DatabaseName = App.Path & "\Report\report.mdb"
GldatPrimaryRS.RecordsetType = 1
GldatPrimaryRS.RecordSource = Gltemp + Glcxconcent + " order by 日期,时间 asc"
lblglbt.FontSize = 22
lblglbt.Caption = "焦作中州炭素有限公司自动配料系统干料年度报表"
tbl = 0
Glcxconcent = ""
Exit Sub
Else
tbl = 0
Glcxconcent = ""
Unload Glrptfrm
Exit Sub
End If
End Sub
Private Sub Glcmdclose_Click()
Screen.MousePointer = vbDefault
Unload Me
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?