📄 formrk.frm
字号:
Top = 3120
Width = 1695
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "今日入库:"
Height = 180
Left = 240
TabIndex = 26
Top = 3240
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "库存总数:"
Height = 180
Left = 240
TabIndex = 25
Top = 2760
Width = 900
End
Begin VB.Label Labelkc
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "楷体_GB2312"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1320
TabIndex = 24
Top = 2640
Width = 1695
End
End
Begin VB.Frame Frame1
Height = 3855
Left = 120
TabIndex = 14
Top = 240
Width = 3200
Begin VB.ComboBox Comboclass1
Height = 300
Left = 1200
TabIndex = 1
Text = "请选择产品类别"
Top = 960
Width = 1815
End
Begin VB.TextBox Texthdwq
Height = 270
Left = 1200
TabIndex = 4
Top = 2400
Width = 1815
End
Begin VB.TextBox Textp
Height = 270
Left = 1200
TabIndex = 6
Top = 3360
Width = 1815
End
Begin VB.TextBox Textname
Height = 270
Left = 1200
TabIndex = 3
Top = 1920
Width = 1815
End
Begin VB.TextBox Textmodel
Height = 270
Left = 1200
TabIndex = 2
Top = 1440
Width = 1815
End
Begin VB.TextBox Textsn
Height = 270
Left = 1200
TabIndex = 0
Top = 480
Width = 1815
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 255
Left = 1200
TabIndex = 5
Top = 2880
Width = 1815
_ExtentX = 3201
_ExtentY = 450
_Version = 393216
Format = 66453505
CurrentDate = 39171
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "入库人员:"
Height = 180
Left = 240
TabIndex = 23
Top = 3360
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "入库日期:"
Height = 180
Left = 240
TabIndex = 22
Top = 2880
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "入库数量:"
Height = 180
Left = 240
TabIndex = 21
Top = 2400
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "产品名称:"
Height = 180
Left = 240
TabIndex = 20
Top = 1920
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "产品型号:"
Height = 180
Left = 240
TabIndex = 19
Top = 1440
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "产品类别:"
Height = 180
Left = 240
TabIndex = 18
Top = 960
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "产品条码:"
Height = 180
Left = 240
TabIndex = 17
Top = 480
Width = 900
End
End
End
Attribute VB_Name = "FormRK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command_print_Click()
DataReport1.Show 1
End Sub
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 CommandOK_Click()
'----------------------------------------------------------------检查信息完整性
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("model") = Trim(Textmodel.Text)
Adodc1.Recordset("name") = Trim(Textname.Text)
Adodc1.Recordset("hdwq") = Trim(Texthdwq.Text)
Adodc1.Recordset("inputdate") = Str(DTPicker1.Value) + " " + Str(Time)
Adodc1.Recordset("inputp") = Trim(Textp.Text)
Adodc1.Recordset.Update
Call stock
MsgBox "入库成功!", vbOKOnly, "提示"
Call clear
Else
Adodc1.Refresh
' Adodc1.Recordset.CancelUpdate
Exit Sub
End If
DataGrid1.Refresh
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 clear()
Textsn = ""
Comboclass1 = "请选择产品类别"
Textmodel = ""
Textname = ""
Texthdwq = ""
Labelkc.Caption = ""
Textsn.SetFocus
DTPicker1.Value = Date
End Sub
Private Sub stock()
Dim con As Integer
Adodc2.Refresh
Adodc2.Recordset.Find "sn='" & Trim(Textsn.Text) & "'"
If Adodc2.Recordset.EOF Then
Adodc2.Recordset.AddNew
Adodc2.Recordset("sn") = Trim(Textsn.Text)
Adodc2.Recordset("classname") = Trim(Comboclass1.Text)
'Adodc2.Recordset("classname") = Adodc3.Recordset("classid")
Adodc2.Recordset("model") = Trim(Textmodel.Text)
Adodc2.Recordset("name") = Trim(Textname.Text)
Adodc2.Recordset("hdwq") = Trim(Texthdwq.Text)
Else
con = Adodc2.Recordset("hdwq")
Adodc2.Recordset("hdwq") = con + Val(Texthdwq.Text)
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 "classid= '" & Adodc2.Recordset!classname & "'"
Labelkc.Caption = Adodc2.Recordset("hdwq")
Textsn.Text = Adodc2.Recordset("sn")
Comboclass1.Text = Adodc2.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 + -