📄 formck.frm
字号:
AutoSize = -1 'True
Caption = "出库日期:"
Height = 180
Left = 240
TabIndex = 22
Top = 2880
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "出库人员:"
Height = 180
Left = 240
TabIndex = 21
Top = 3360
Width = 900
End
End
Begin VB.Frame Frame2
Height = 3855
Left = 3960
TabIndex = 15
Top = 240
Width = 3200
Begin VB.ComboBox Comboclass2
Height = 300
ItemData = "FormCK.frx":F84A
Left = 240
List = "FormCK.frx":F878
TabIndex = 9
Text = "请选择产品类别"
Top = 360
Width = 2775
End
Begin VB.ComboBox Combo2
Height = 300
Left = 240
TabIndex = 10
Text = "选择产品型号"
Top = 840
Width = 2775
End
Begin VB.ComboBox Combo3
Height = 300
Left = 240
TabIndex = 11
Text = "选择出库人员"
Top = 1320
Width = 2775
End
Begin VB.Label Labelkc
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1320
TabIndex = 19
Top = 2640
Width = 1695
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "库存总数:"
Height = 180
Left = 240
TabIndex = 18
Top = 2760
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "今日出库:"
Height = 180
Left = 240
TabIndex = 17
Top = 3240
Width = 900
End
Begin VB.Label Label10
BackColor = &H00C0C0C0&
Enabled = 0 'False
Height = 375
Left = 1320
TabIndex = 16
Top = 3120
Width = 1695
End
End
Begin VB.CommandButton Command1
Caption = "浩 天 网 络"
DisabledPicture = "FormCK.frx":F8DF
DownPicture = "FormCK.frx":125D9
DragIcon = "FormCK.frx":152D3
Enabled = 0 'False
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3735
Left = 3360
MaskColor = &H00000000&
TabIndex = 14
TabStop = 0 'False
Top = 360
Width = 520
End
End
Attribute VB_Name = "FormCK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim kc As Integer
Private Sub Form_Activate()
Adodc3.Refresh
Adodc3.Recordset.MoveFirst
Do While Not Adodc3.Recordset.EOF
Comboclass1.AddItem Adodc3.Recordset!classname
Adodc3.Recordset.MoveNext
Loop
Call clear
End Sub
Private Sub Form_Load()
Frame2.Enabled = False
End Sub
Private Sub CommandSelect_Click()
Frame1.Enabled = False
Frame2.Enabled = True
CommandOK.Enabled = False
Commandclear.Caption = "我要出库"
CommandSelect.Caption = "确定查询"
End Sub
Private Sub Commandclear_Click()
If Commandclear.Caption = "清 空" Then
Call clear
Else
Frame1.Enabled = True
Frame2.Enabled = False
CommandSelect.Caption = "我要查询"
Commandclear.Caption = "清 空"
CommandOK.Enabled = True
End If
End Sub
Private Sub Commandexit_Click()
Unload Me
End Sub
Private Sub CommandOK_Click()
Adodc2.Refresh
Adodc2.Recordset.Find "sn='" & Trim(Textsn.Text) & "'"
If Adodc2.Recordset.EOF Then
MsgBox "没有相关硬件", 0, "提示"
Exit Sub
End If
kc = Adodc2.Recordset("hdwq")
If Val(Texthdwq.Text) - kc > 0 Then
MsgBox "库存数量不足!请核对后再出库!", vbExclamation + vbOKOnly, "提示"
Exit Sub
End If
'----------------------------------------------------------------检查信息完整性
If Textsn = "" Then
MsgBox "请添写产品条码!", vbOKOnly, "浩天网络"
Textsn.SetFocus
Exit Sub
End If
If Comboclass1 = "" Then
MsgBox "请添写产品类别!", vbOKOnly, "浩天网络"
Comboclass1.SetFocus
Exit Sub
End If
If Textmodel = "" Then
MsgBox "请添写产品型号!", vbOKOnly, "浩天网络"
Textmodel.SetFocus
Exit Sub
End If
If Textname = "" Then
MsgBox "请添写产品名称!", vbOKOnly, "浩天网络"
Textname.SetFocus
Exit Sub
End If
If Val(Texthdwq) <= 0 Then
MsgBox "请添写出库数量!", vbOKOnly, "浩天网络"
Texthdwq.SetFocus
Exit Sub
End If
If Textp = "" Then
MsgBox "请添写出库人!", vbOKOnly, "浩天网络"
Textp.SetFocus
Exit Sub
End If
'-----------------------------------------------------------------检查完毕
Dim an As Integer
an = MsgBox("********你确定此操作吗?**********" & vbCrLf _
& "产品条码:" & Textsn.Text & vbCrLf _
& "产品类别:" & Comboclass1.Text & vbCrLf _
& "产品型号:" & Textmodel.Text & vbCrLf _
& "产品名称:" & Textname.Text & vbCrLf _
& "出库数量:" & Texthdwq.Text & vbCrLf _
& "出库日期:" & DTPicker1.Value & vbCrLf _
& "出库人员:" & Textp.Text & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "浩天网络")
If an = vbOK Then
'---------------------------------------------------开始出库
Adodc1.Refresh
'Adodc3.Refresh
Adodc1.Recordset.AddNew
'Adodc3.Recordset.Find "classname='" & Trim(Comboclass1.Text) & "'"
Adodc1.Recordset("sn") = Trim(Textsn.Text)
Adodc1.Recordset("classname") = Trim(Comboclass1.Text)
'Adodc1.Recordset("classname") = Adodc3.Recordset("classid")
Adodc1.Recordset("model") = Trim(Textmodel.Text)
Adodc1.Recordset("name") = Trim(Textname.Text)
Adodc1.Recordset("hdwq") = Trim(Texthdwq.Text)
Adodc1.Recordset("putupdate") = Str(DTPicker1.Value) + " " + Str(Time)
Adodc1.Recordset("putupp") = Trim(Textp.Text)
Adodc1.Recordset.Update
Call stock
MsgBox "出库成功!", vbOKOnly, "提示"
Call clear
Else
Adodc1.Refresh
' Adodc1.Recordset.CancelUpdate
Exit Sub
End If
End Sub
'--------------------------------------------
Private Sub clear()
Textsn = ""
Comboclass1 = "请选择产品类别"
Textmodel = ""
Textname = ""
Texthdwq = ""
Textsn.SetFocus
Labelkc.Caption = ""
DTPicker1.Value = Date
End Sub
Private Sub stock()
Adodc2.Refresh
Adodc2.Recordset.Find "sn='" & Trim(Textsn.Text) & "'"
If Adodc2.Recordset.EOF Then
MsgBox "没有该产品的库存!请确认产品条码正确!", vbOKOnly, "提示信息"
Exit Sub
Else
Adodc2.Recordset("hdwq") = kc - Val(Texthdwq.Text)
Labelkc.Caption = Adodc2.Recordset("hdwq")
End If
Adodc2.Recordset.Update
End Sub
Private Sub Textsn_Change()
Adodc2.Refresh
Adodc2.Recordset.Find "sn='" & Trim(Textsn.Text) & "'"
If Adodc2.Recordset.EOF Then
Labelkc.Caption = ""
Exit Sub
Else
'Adodc3.Refresh
'Adodc3.Recordset.Find "classname='" & Adodc2.Recordset!classname & "'"
Labelkc.Caption = Adodc2.Recordset("hdwq")
Textsn.Text = Adodc2.Recordset("sn")
Comboclass1.Text = Adodc2.Recordset("classname")
'Comboclass1.Text = Adodc3.Recordset("classname")
Textmodel.Text = Adodc2.Recordset("model")
Textname.Text = Adodc2.Recordset("name")
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -