📄 按日期查询.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form 查询方式之——按日期查询
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 7185
ClientLeft = 45
ClientTop = 330
ClientWidth = 9795
Icon = "按日期查询.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 7185
ScaleWidth = 9795
ShowInTaskbar = 0 'False
Begin MSAdodcLib.Adodc outstorehouse
Height = 375
Left = 3600
Top = 7320
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 = 7320
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
Begin VB.Frame Frame3
Caption = "入库信息"
Height = 6015
Left = 120
TabIndex = 7
Top = 1080
Width = 9615
Begin MSFlexGridLib.MSFlexGrid list1
Height = 2655
Left = 120
TabIndex = 9
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 = 8
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 = 10
Top = 3000
Width = 720
End
End
Begin VB.Frame Frame2
Height = 975
Left = 5640
TabIndex = 6
Top = 0
Width = 4095
Begin VB.CommandButton Command2
Caption = "返回(&R)"
Height = 615
Left = 2280
TabIndex = 3
Top = 240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "查找(&F)"
Height = 615
Left = 360
TabIndex = 2
Top = 240
Width = 1575
End
End
Begin VB.Frame Frame1
Height = 975
Left = 120
TabIndex = 4
Top = 0
Width = 5415
Begin MSComCtl2.DTPicker DTPdate1
Height = 375
Left = 1080
TabIndex = 0
Top = 360
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 21037057
CurrentDate = 38211
End
Begin MSComCtl2.DTPicker DTPdate2
Height = 375
Left = 3840
TabIndex = 1
Top = 360
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 21037057
CurrentDate = 38211
End
Begin VB.Label Label3
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 = 3000
TabIndex = 11
Top = 450
Width = 840
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 = 5
Top = 450
Width = 840
End
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 list2SQL As String
Dim list1SQL As String
list1SQL = "select * from outstorehouse where 出库日期 between #" & Format(DTPdate1, "yyyy-mm-dd") & "# and #" & Format(DTPdate2, "yyyy-mm-dd") & "#"
list2SQL = "select * from instorehouse where 入库日期 between #" & Format(DTPdate1, "yyyy-mm-dd") & "# and #" & Format(DTPdate2, "yyyy-mm-dd") & "#"
Call list1disp(list1SQL)
Call list2disp(list2SQL)
End Sub
Private Sub Command2_Click()
Unload Me
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"
DTPdate1.Value = Date
DTPdate2.Value = Date
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 + -