📄 按物查询.frm
字号:
FixedCols = 0
BackColor = 12713466
End
Begin MSFlexGridLib.MSFlexGrid list3
Height = 855
Left = 120
TabIndex = 6
TabStop = 0 'False
Top = 6000
Width = 9735
_ExtentX = 17171
_ExtentY = 1508
_Version = 393216
Rows = 3
Cols = 10
FixedCols = 0
BackColor = 12320251
End
Begin MSFlexGridLib.MSFlexGrid list1
Height = 2655
Left = 120
TabIndex = 5
TabStop = 0 'False
Top = 3000
Width = 9735
_ExtentX = 17171
_ExtentY = 4683
_Version = 393216
Rows = 10
Cols = 18
FixedCols = 0
BackColor = 12320251
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "该物库存信息"
Height = 180
Index = 1
Left = 240
TabIndex = 9
Top = 5760
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "该物出库信息"
Height = 180
Index = 0
Left = 240
TabIndex = 8
Top = 2760
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "该物入库信息"
Height = 180
Left = 240
TabIndex = 7
Top = 240
Width = 1080
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 list1SQL As String
Dim list2SQL As String
Dim list3SQL As String
If Trim(Text1(0)) = "" Or Trim(Text1(1)) = "" Then
MsgBox ("品名和规格不能为空!")
Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0))
Text1(0).SetFocus
Exit Sub
Else
list1SQL = "select * from outstorehouse where 品名='" + Trim(Text1(0)) + "' and 规格='" + Trim(Text1(1)) + "'"
list2SQL = "select * from instorehouse where 品名='" + Trim(Text1(0)) + "' and 规格='" + Trim(Text1(1)) + "'"
list3SQL = "select * from stock where 品名='" + Trim(Text1(0)) + "' and 规格='" + Trim(Text1(1)) + "'"
Call list1disp(list1SQL)
Call list2disp(list2SQL)
Call list3disp(list3SQL)
End If
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"
stock.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
Text1(0).Text = ""
Text1(1).Text = ""
Text1(0).BackColor = &HFFC0C0
Text1(1).BackColor = &HFFC0C0
Call list1disp("Outstorehouse")
Call list2disp("Instorehouse")
Call list3disp("stock")
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HC0FFFF
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &HFFC0C0
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
Private Sub list3disp(StrSQL As String)
Dim roww As Integer ''行
roww = 1
list3.Clear
list3.rows = 1
Call list3def
stock.RecordSource = StrSQL
stock.Refresh
If stock.Recordset.EOF = False Then
stock.Recordset.MoveFirst
End If
Do While stock.Recordset.EOF = False
For i = 0 To 5 '给空值赋值
If IsNull(stock.Recordset.Fields(i)) = True Then
stock.Recordset.Fields(i) = ""
End If
Next i
list3.rows = list3.rows + 1
list3.TextMatrix(roww, 0) = stock.Recordset.Fields(0)
list3.TextMatrix(roww, 1) = stock.Recordset.Fields(1)
list3.TextMatrix(roww, 2) = stock.Recordset.Fields(2)
list3.TextMatrix(roww, 3) = stock.Recordset.Fields(3)
list3.TextMatrix(roww, 4) = stock.Recordset.Fields(4)
list3.TextMatrix(roww, 5) = stock.Recordset.Fields(5)
roww = roww + 1
stock.Recordset.MoveNext
Loop
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 list3def()
list3.TextMatrix(0, 0) = "品名"
list3.TextMatrix(0, 1) = "规格"
list3.TextMatrix(0, 2) = "导电"
list3.TextMatrix(0, 3) = "硬度"
list3.TextMatrix(0, 4) = "数量"
list3.TextMatrix(0, 5) = "单位"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -