📄 frmtotalmonth.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 FrmTotalmonth
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 7185
ClientLeft = 45
ClientTop = 330
ClientWidth = 9810
Icon = "FrmTotalmonth.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 7185
ScaleWidth = 9810
ShowInTaskbar = 0 'False
Begin VB.Frame Frame4
Caption = "本月入/出库数据 "
Height = 975
Left = 6120
TabIndex = 10
Top = 0
Width = 3615
Begin VB.Label Label4
Caption = "Label4"
Height = 255
Left = 240
TabIndex = 12
Top = 600
Width = 3015
End
Begin VB.Label Label3
Caption = "Label3"
Height = 255
Left = 240
TabIndex = 11
Top = 360
Width = 2415
End
End
Begin VB.Frame Frame1
Height = 975
Left = 120
TabIndex = 8
Top = 0
Width = 2535
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 = "FrmTotalmonth.frx":030A
Left = 720
List = "FrmTotalmonth.frx":0332
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 = 120
TabIndex = 9
Top = 405
Width = 630
End
End
Begin VB.Frame Frame2
Height = 975
Left = 2760
TabIndex = 7
Top = 0
Width = 3255
Begin VB.CommandButton Command1
Caption = "查找(&F)"
Height = 615
Left = 120
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "返回(&R)"
Height = 615
Left = 1680
TabIndex = 2
Top = 240
Width = 1455
End
End
Begin VB.Frame Frame3
Caption = "入库信息"
Height = 6015
Left = 120
TabIndex = 3
Top = 1080
Width = 9615
Begin MSFlexGridLib.MSFlexGrid list1
Height = 2655
Left = 120
TabIndex = 4
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 = 5
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 = 6
Top = 3000
Width = 720
End
End
Begin MSAdodcLib.Adodc outstorehouse
Height = 375
Left = 3600
Top = 7440
Width = 2055
_ExtentX = 3625
_ExtentY = 661
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 = 375
Left = 840
Top = 7440
Width = 2295
_ExtentX = 4048
_ExtentY = 661
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 = "FrmTotalmonth"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public list1count As Integer
Public list2count As Integer
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)
Label3.Caption = "本月进库次数为〖" + Trim(Str(list2count)) + "〗"
Label4.Caption = "本月出库次数为〖" + Trim(Str(list1count)) + "〗"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = (Mainform.Height - Me.Height) / 2 - 800
Me.Left = (Mainform.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")
Label3.Caption = "总进库次数为〖" + Trim(Str(list2count)) + "〗"
Label4.Caption = "总出库次数为〖" + Trim(Str(list1count)) + "〗"
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
list2count = instorehouse.Recordset.RecordCount
Else
list2count = 0
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
list1count = outstorehouse.Recordset.RecordCount
outstorehouse.Recordset.MoveFirst
Else
list1count = 0
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 + -