📄 frmprintmonth.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form 打印方式二
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 7200
ClientLeft = 45
ClientTop = 330
ClientWidth = 9840
Icon = "FrmPrintMonth.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 7200
ScaleWidth = 9840
ShowInTaskbar = 0 'False
Begin VB.Frame Frame3
Caption = "入库信息"
Height = 6015
Left = 120
TabIndex = 9
Top = 1080
Width = 9615
Begin MSFlexGridLib.MSFlexGrid list1
Height = 2655
Left = 120
TabIndex = 10
TabStop = 0 'False
Top = 3240
Width = 9375
_ExtentX = 16536
_ExtentY = 4683
_Version = 393216
Rows = 10
Cols = 18
FixedCols = 0
BackColor = 12648187
AllowUserResizing= 3
End
Begin MSFlexGridLib.MSFlexGrid list2
Height = 2655
Left = 120
TabIndex = 11
TabStop = 0 'False
Top = 240
Width = 9375
_ExtentX = 16536
_ExtentY = 4683
_Version = 393216
Rows = 10
Cols = 12
FixedCols = 0
BackColor = 12648187
AllowUserResizing= 3
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "出库信息"
Height = 180
Left = 240
TabIndex = 12
Top = 3000
Width = 720
End
End
Begin VB.Frame Frame2
Height = 1095
Left = 4800
TabIndex = 8
Top = 0
Width = 4935
Begin VB.CommandButton Command3
Caption = "打印(&P)"
Height = 615
Left = 1680
TabIndex = 4
Top = 240
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "返回(&R)"
Height = 615
Left = 3240
TabIndex = 5
Top = 240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "查找(&F)"
Height = 615
Left = 120
TabIndex = 3
Top = 240
Width = 1455
End
End
Begin VB.Frame Frame1
Height = 1095
Left = 120
TabIndex = 6
Top = 0
Width = 4575
Begin VB.CheckBox Check2
Caption = "入库信息打印"
Height = 180
Left = 2640
TabIndex = 2
Top = 600
Value = 1 'Checked
Width = 1815
End
Begin VB.CheckBox Check1
Caption = "出库信息打印"
Height = 255
Left = 2640
TabIndex = 1
Top = 240
Value = 1 'Checked
Width = 1815
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
ItemData = "FrmPrintMonth.frx":0442
Left = 840
List = "FrmPrintMonth.frx":046A
Style = 2 'Dropdown List
TabIndex = 0
Top = 360
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "月份:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 240
TabIndex = 7
Top = 420
Width = 630
End
End
Begin MSAdodcLib.Adodc outstorehouse
Height = 495
Left = 3600
Top = 7440
Width = 2055
_ExtentX = 3625
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
_Version = 393216
End
Begin MSAdodcLib.Adodc instorehouse
Height = 495
Left = 840
Top = 7440
Width = 2295
_ExtentX = 4048
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
_Version = 393216
End
End
Attribute VB_Name = "打印方式二"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '查询
Dim list1SQL As String
Dim list2SQL As String
If Trim(Combo1.Text) = "" Then
MsgBox ("请选择你要查询打印的月份!")
Combo1.SetFocus
Exit Sub
End If
list1SQL = "select * from outstorehouse where month(出库日期)= '" + Left(Trim(Combo1.Text), 1) + "'"
list2SQL = "select * from instorehouse where month(入库日期)= '" + Left(Trim(Combo1.Text), 1) + "'"
Call list1disp(list1SQL)
Call list2disp(list2SQL)
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click() '打印
If Check2.Value = 1 Then
With DataEnvironment1
If .rsprintinstorehouse.State = adStateOpen Then
.rsprintinstorehouse.Close
End If
If Trim(Combo1.Text) = "" Then
aa = Trim(Str(Month(Date)))
Else
aa = Left(Trim(Combo1.Text), 1)
End If
.printinstorehouse aa '对问号赋值
If .rsprintinstorehouse.RecordCount > 0 Then
MonthinReport.Show
Else
MsgBox ("没有找到记录!")
Exit Sub
End If
End With
End If
If Check1.Value = 1 Then
With DataEnvironment1
If .rsprintoutstorehouse.State = adStateOpen Then
.rsprintoutstorehouse.Close
End If
If Trim(Combo1.Text) = "" Then
bb = Trim(Str(Month(Date)))
Else
bb = Left(Trim(Combo1.Text), 1)
End If
.printoutstorehouse bb '对问号赋值
If .rsprintoutstorehouse.RecordCount > 0 Then
monthoutReport.Show
Else
MsgBox ("没有找到记录!")
Exit Sub
End If
End With
End If
End Sub
Private Sub Form_Load()
Me.Top = (主界面.Height - Me.Height) / 2 - 800
Me.Left = (主界面.Width - Me.Width) / 2
Me.Caption = "仓库管理系统→" & "按月打印"
instorehouse.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
outstorehouse.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
Call list1disp("outstorehouse")
Call list2disp("instorehouse")
End Sub
Private Sub list2def() '将list2的表头初始化
list2.TextMatrix(0, 0) = "品名"
list2.TextMatrix(0, 1) = "规格"
list2.TextMatrix(0, 2) = "导电"
list2.TextMatrix(0, 3) = "硬度"
list2.TextMatrix(0, 4) = "数量"
list2.TextMatrix(0, 5) = "单位"
list2.TextMatrix(0, 6) = "入库日期"
list2.TextMatrix(0, 7) = "入料人编号"
list2.TextMatrix(0, 8) = "入料人"
list2.TextMatrix(0, 9) = "经手人"
list2.TextMatrix(0, 10) = "说明"
list2.TextMatrix(0, 11) = "入库标识"
End Sub
Private Sub list1def() '将list1的表头初始化
list1.TextMatrix(0, 0) = "品名"
list1.TextMatrix(0, 1) = "规格"
list1.TextMatrix(0, 2) = "导电"
list1.TextMatrix(0, 3) = "硬度"
list1.TextMatrix(0, 4) = "数量"
list1.TextMatrix(0, 5) = "单位"
list1.TextMatrix(0, 6) = "毛坯尺寸"
list1.TextMatrix(0, 7) = "毛坯数量"
list1.TextMatrix(0, 8) = "成品尺寸"
list1.TextMatrix(0, 9) = "成品数量"
list1.TextMatrix(0, 10) = "余料"
list1.TextMatrix(0, 11) = "报废"
list1.TextMatrix(0, 12) = "出库日期"
list1.TextMatrix(0, 13) = "领料人编号"
list1.TextMatrix(0, 14) = "领料人"
list1.TextMatrix(0, 15) = "经手人"
list1.TextMatrix(0, 16) = "其它用途"
list1.TextMatrix(0, 17) = "说明"
End Sub
Private Sub list2disp(StrSQL As String)
Dim roww As Integer ''行
roww = 1
list2.Clear
list2.rows = 1
Call list2def
instorehouse.RecordSource = StrSQL
instorehouse.Refresh
If instorehouse.Recordset.EOF = False Then
instorehouse.Recordset.MoveFirst
End If
Do While instorehouse.Recordset.EOF = False
list2.rows = list2.rows + 1
list2.TextMatrix(roww, 0) = instorehouse.Recordset.Fields(0)
list2.TextMatrix(roww, 1) = instorehouse.Recordset.Fields(1)
list2.TextMatrix(roww, 2) = instorehouse.Recordset.Fields(2)
list2.TextMatrix(roww, 3) = instorehouse.Recordset.Fields(3)
list2.TextMatrix(roww, 4) = instorehouse.Recordset.Fields(4)
list2.TextMatrix(roww, 5) = instorehouse.Recordset.Fields(5)
list2.TextMatrix(roww, 6) = instorehouse.Recordset.Fields(6)
list2.TextMatrix(roww, 7) = instorehouse.Recordset.Fields(7)
list2.TextMatrix(roww, 8) = instorehouse.Recordset.Fields(8)
list2.TextMatrix(roww, 9) = instorehouse.Recordset.Fields(9)
list2.TextMatrix(roww, 10) = instorehouse.Recordset.Fields(10)
list2.TextMatrix(roww, 11) = instorehouse.Recordset.Fields(11)
roww = roww + 1
instorehouse.Recordset.MoveNext
Loop
End Sub
Private Sub list1disp(StrSQL As String)
Dim roww As Integer ''行
roww = 1
list1.Clear
list1.rows = 1
Call list1def
outstorehouse.RecordSource = StrSQL
outstorehouse.Refresh
If outstorehouse.Recordset.EOF = False Then
outstorehouse.Recordset.MoveFirst
End If
Do While outstorehouse.Recordset.EOF = False
For i = 0 To 17 '给空值赋值
If IsNull(outstorehouse.Recordset.Fields(i)) = True Then
outstorehouse.Recordset.Fields(i) = ""
End If
Next i
list1.rows = list1.rows + 1
list1.TextMatrix(roww, 0) = outstorehouse.Recordset.Fields(0)
list1.TextMatrix(roww, 1) = outstorehouse.Recordset.Fields(1)
list1.TextMatrix(roww, 2) = outstorehouse.Recordset.Fields(2)
list1.TextMatrix(roww, 3) = outstorehouse.Recordset.Fields(3)
list1.TextMatrix(roww, 4) = outstorehouse.Recordset.Fields(4)
list1.TextMatrix(roww, 5) = outstorehouse.Recordset.Fields(5)
list1.TextMatrix(roww, 6) = outstorehouse.Recordset.Fields(6)
list1.TextMatrix(roww, 7) = outstorehouse.Recordset.Fields(7)
list1.TextMatrix(roww, 8) = outstorehouse.Recordset.Fields(8)
list1.TextMatrix(roww, 9) = outstorehouse.Recordset.Fields(9)
list1.TextMatrix(roww, 10) = outstorehouse.Recordset.Fields(10)
list1.TextMatrix(roww, 11) = outstorehouse.Recordset.Fields(11)
list1.TextMatrix(roww, 12) = outstorehouse.Recordset.Fields(12)
list1.TextMatrix(roww, 13) = outstorehouse.Recordset.Fields(13)
list1.TextMatrix(roww, 14) = outstorehouse.Recordset.Fields(14)
list1.TextMatrix(roww, 15) = outstorehouse.Recordset.Fields(15)
list1.TextMatrix(roww, 16) = outstorehouse.Recordset.Fields(16)
list1.TextMatrix(roww, 17) = outstorehouse.Recordset.Fields(17)
roww = roww + 1
outstorehouse.Recordset.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -