图5.4入库界面设置
与入库界面相关代码
Public rk As String '入库的类型
Public reccount As Integer '记录条数
Public row1 As Integer '单击list2时返回的行数
Private Sub Command1_Click() '补充数据
'判断输入的数据是否都为空
'-----------------------------------------------补充出库信息 --------------------------
If Trim(Text1(13)) <> "" Or Trim(Text1(14)) <> "" Or Trim(Text1(15)) <> "" Or Trim(Text1(16)) <> "" Then
outstorehouse.RecordSource = "select * from outstorehouse where 编号=" + list2.TextMatrix(row1, 4)
outstorehouse.Refresh
With outstorehouse.Recordset
.Fields(8) = Text1(13)
.Fields(9) = Text1(14)
.Fields(10) = Text1(15)
.Fields(11) = Text1(16)
.Update
End With
Call Command2_Click
Command1.Enabled = False
Else
MsgBox ("请输入数据!")
End If
'---------------------------------------------
End Sub
Private Sub Command2_Click() '补充出库信息时的数据清零
For i = 13 To 16
Text1(i).Text = ""
Next i
End Sub
Private Sub Command3_Click() '按确定按钮
'-------------------------------判断输入----------------------------
If Option2.Value = False Then
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
Else
If Trim(Text1(0).Text) = "" Or Trim(Text1(1).Text) = "" Then '入库的关键信息
MsgBox ("品名与规格不能为空!")
Text1(0).SetFocus
Exit Sub
End If
If Trim(Text1(11).Text) = "" Or Trim(Text1(12).Text) = "" Then '当要补充出库的信息时
MsgBox ("品名与规格不能为空!")
Text1(11).SetFocus
Exit Sub
End If
If Trim(Text1(8).Text) = "" Then
MsgBox ("请输入领料人!")
Text1(7).SetFocus
Exit Sub
End If
End If
If IsNumeric(Text1(4)) = False Then '判断数量是否为数值
MsgBox ("你输入的数量有误,请输入数值!")
Text1(4).Text = ""
Text1(4).SetFocus
Exit Sub
End If
'-------------------------- -----------------------------------------
Text1(9).Text = Operater1
'----------给进库表增加信息
instorehouse.RecordSource = "select * from instorehouse"
instorehouse.Refresh
With instorehouse.Recordset
.AddNew
.Fields(0) = Text1(0).Text
.Fields(1) = Text1(1).Text
.Fields(2) = Text1(2).Text
.Fields(3) = Text1(3).Text
.Fields(4) = Val(Text1(4).Text)
.Fields(5) = Text1(5).Text
.Fields(6) = Date
.Fields(7) = Text1(7).Text
.Fields(8) = Text1(8).Text
.Fields(9) = Text1(9).Text
.Fields(10) = Text1(10).Text
.Fields(11) = rk
.Update
End With
Call list1disp
'--------------------
'----------给库存表增加信息
stock.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 规格 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
stock.Refresh
If stock.Recordset.EOF = True Then
With stock.Recordset
.AddNew
.Fields(0) = Text1(0).Text
.Fields(1) = Text1(1).Text
.Fields(2) = Text1(2).Text
.Fields(3) = Text1(3).Text
.Fields(4) = Val(Text1(4).Text)
.Fields(5) = Text1(5).Text
.Update
End With
Else
With stock.Recordset
.Fields(4) = .Fields(4) + Text1(4)
.Update
End With
End If
'--------------------
'----------给出库表增加信息
outstorehouse.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 规格 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
outstorehouse.Refresh
'--------------------
Call clearzore
Text1(6) = Date
Text1(9) = Operater1
Text1(0).SetFocus
End Sub
Private Sub Command4_Click() '取消
Call clearzore
Text1(0).SetFocus
End Sub
Private Sub Command5_Click() '返回
Unload Me
End Sub
Private Sub command6_Click() '出库材料的查询
'---------------------判断出库查询输入的数据--------------
If Trim(Text1(11).Text) = "" Or Trim(Text1(12).Text) = "" Then '当要补充出库的信息时
MsgBox ("品名与规格不能为空!")
Text1(11).SetFocus
Exit Sub
End If
Call list2disp
Command1.Enabled = False
'-------------------------------------------------
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
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>