仓库管理系统数据库课程设计 第7页
list1.rows = list1.rows + 1
list1.TextMatrix(roww, 0) = instorehouse.Recordset.Fields(0)
list1.TextMatrix(roww, 1) = instorehouse.Recordset.Fields(1)
list1.TextMatrix(roww, 2) = instorehouse.Recordset.Fields(2)
list1.TextMatrix(roww, 3) = instorehouse.Recordset.Fields(3)
list1.TextMatrix(roww, 4) = instorehouse.Recordset.Fields(4)
list1.TextMatrix(roww, 5) = instorehouse.Recordset.Fields(5)
list1.TextMatrix(roww, 6) = instorehouse.Recordset.Fields(6)
roww = roww + 1
instorehouse.Recordset.MoveNext
Loop
End Sub
与出库界面相关的代码
Private Sub Command1_Click()
Dim YesNo As String
'-------------------------------判断输入----------------------------
If Trim(Text1(0).Text) = "" Or Trim(Text1(1).Text) = "" Then '当不要补充出库的信息时
MsgBox ("品名与规格不能为空!")
Text1(0).SetFocus
Exit Sub
End If
If Trim(Text1(8).Text) = "" Then
MsgBox ("请输入领料人!")
Text1(7).SetFocus
Exit Sub
End If
If IsNumeric(Text1(4)) = False Then '判断数量是否为数值
MsgBox ("你输入的数量有误,请输入数值!")
Text1(4).Text = ""
Text1(4).SetFocus
Exit Sub
End If
'---------------------------------------------------------------------
'-------------------------修改库存中的信息----------------------------
stock.RecordSource = "select * from stock where 品名='" + Trim(Text1(0)) + "' and 规格='" + Trim(Text1(1)) + "'"
stock.Refresh
If stock.Recordset.EOF = True Then
MsgBox ("仓库中无此物品,请采购!")
Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0).Text)
Text1(0).SetFocus
Exit Sub
Else '存在此物,判断它的数量值
With stock.Recordset
If .Fields(4) < Val(Text1(4)) And .Fields(4) <> 0 Then
YesNo = MsgBox("数量超出库存数量【" + Trim(Str(.Fields(4))) + "】是否全取!", vbYesNo)
'------------------- '根据操作来进行操作
If YesNo = "6" Then
temp = .Fields(4)
.Fields(4) = 0
.Update
'给出库加信息
outstorehouse.RecordSource = "outstorehouse"
outstorehouse.Refresh
With outstorehouse.Recordset
.AddNew
.Fields(0) = Text1(0)
.Fields(1) = Text1(1)
.Fields(2) = Text1(2)
.Fields(3) = Text1(3)
.Fields(4) = temp
.Fields(5) = Text1(5)
.Fields(6) = Date
.Fields(7) = Text1(7)
.Fields(8) = Text1(8)
.Fields(9) = Text1(9)
.Fields(10) = Text1(10)
.Update
End With
Call list1disp
Call Command2_Click
'------------------------------
Else
Text1(4).SelStart = 0
Text1(4).SelLength = Len(Text1(4))
Text1(4).SetFocus
Exit Sub
End If
'-------------------
Else
'--------------------
If .Fields(4) = 0 Then
MsgBox ("此物品已为空!")
Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0))
Text1(0).SetFocus
Exit Sub
Else
.Fields(4) = .Fields(4) - Val(Text1(4))
.Update
'给出库加信息
outstorehouse.RecordSource = "outstorehouse"
outstorehouse.Refresh
With outstorehouse.Recordset
.AddNew
.Fields(0) = Text1(0)
.Fields(1) = Text1(1)
.Fields(2) = Text1(2)
.Fields(3) = Text1(3)
.Fields(4) = Text1(4)
.Fields(5) = Text1(5)
.Fields(6) = Text1(6)
.Fields(7) = Text1(7)
.Fields(8) = Text1(8)
.Fields(9) = Text1(9)
.Fields(10) = Text1(10)
.Update
End With
Call list1disp
Call Command2_Click
End If
'--------------------
End If
End With
End If
'---------------------------------------------------------------------
'-------------------------给出库添加信息------------------------------
'---------------------------------------------------------------------
End Sub
Private Sub Command2_Click()
Call clearzore
Text1(6).Text = Date
Text1(9).Text = Operater1
Me.Text1(0).SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
www.751com.cn
Me.Caption = "仓库管理系统→" & "出库操作"
outstorehouse.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
person.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"
Call clearzore
Call list1def
Text1(9).Text = Operater1
Text1(6).Text = Date
Call list1disp
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) = "说明"
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页