📄 frmcheckinput.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmCheckInput
BackColor = &H00C0FFC0&
BorderStyle = 1 'Fixed Single
Caption = "商品入库"
ClientHeight = 3855
ClientLeft = 45
ClientTop = 435
ClientWidth = 5940
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3855
ScaleWidth = 5940
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdEnd
Caption = "关闭"
Height = 375
Left = 4680
TabIndex = 11
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdModify
Caption = "修改"
Height = 375
Left = 3240
TabIndex = 10
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdDel
Caption = "删除"
Height = 375
Left = 1800
TabIndex = 9
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdAdd
Caption = "添加"
Height = 375
Left = 360
TabIndex = 8
Top = 3240
Width = 1095
End
Begin MSComCtl2.DTPicker dtpInput
Height = 375
Left = 2040
TabIndex = 7
Top = 1200
Width = 2415
_ExtentX = 4260
_ExtentY = 661
_Version = 393216
Format = 166395905
CurrentDate = 38878
End
Begin VB.TextBox txtJob
Height = 285
Left = 2040
TabIndex = 6
Top = 1920
Width = 2415
End
Begin VB.TextBox txtSum
Height = 285
Left = 2040
TabIndex = 5
Top = 2520
Width = 2415
End
Begin VB.TextBox txtNo
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2040
TabIndex = 1
Top = 480
Width = 2415
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "说明:修改时只能修改数量"
Height = 195
Left = 240
TabIndex = 12
Top = 120
Width = 2160
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入库时间*"
Height = 195
Index = 9
Left = 930
TabIndex = 4
Top = 1320
Width = 795
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入库批次*"
Height = 195
Index = 8
Left = 930
TabIndex = 3
Top = 1920
Width = 795
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数量"
Height = 195
Index = 7
Left = 1320
TabIndex = 2
Top = 2520
Width = 375
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品编号*"
Height = 195
Index = 0
Left = 960
TabIndex = 0
Top = 600
Width = 780
End
End
Attribute VB_Name = "frmCheckInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sql As String
Dim RS As ADODB.Recordset
Dim RS1 As ADODB.Recordset
Private Sub cmdAdd_Click()
'添加
Dim i As Integer
If Trim(Me.txtJob.Text) <> "" And Trim(Me.dtpInput.Value) <> "" And Trim(Me.txtNo.Text) <> "" Then
Sql = "select * from 商品表 where 商品编号=" & Trim(Me.txtNo.Text)
Set RS = dbSelect(Sql)
If Not RS.EOF Then
Set RS = Nothing
Sql = "select * from 入库表 where 商品编号=" & Trim(Me.txtNo.Text)
Sql = Sql & " and 入库时间='" & Trim(Me.dtpInput.Value)
Sql = Sql & "' and 入库批次=" & Trim(Me.txtJob.Text)
Set RS = dbSelect(Sql)
If RS.EOF Then
Sql = "insert into 入库表 values(" & Trim(Me.txtNo.Text)
Sql = Sql & ",'" & Trim(Me.dtpInput.Value)
Sql = Sql & "'," & Trim(Me.txtJob.Text)
Sql = Sql & "," & Trim(Me.txtSum.Text) & ")"
dbOperate Sql
Else
MsgBox "库中已有!"
End If
Else
i = MsgBox("信息库中无此商品!是否添加?", vbOKCancel + vbExclamation, "提示")
If i = 1 Then
frmCheckOther.Show
End If
End If
Set RS = Nothing
Else
MsgBox "主键不能为空!"
End If
End Sub
Private Sub cmdDel_Click()
'删除
If Trim(Me.txtJob.Text) <> "" And Trim(Me.dtpInput.Value) <> "" And Trim(Me.txtNo.Text) <> "" Then
Sql = "select * from 入库表 where 商品编号=" & Trim(Me.txtNo.Text)
Sql = Sql & " and 入库时间='" & Trim(Me.dtpInput.Value)
Sql = Sql & "' and 入库批次=" & Trim(Me.txtJob.Text)
Set RS = dbSelect(Sql)
If Not RS.EOF Then
Sql = "delete * from 入库表 where 商品编号=" & Trim(Me.txtNo.Text)
Sql = Sql & " and 入库时间='" & Trim(Me.dtpInput.Value)
Sql = Sql & "' and 入库批次=" & Trim(Me.txtJob.Text)
dbOperate Sql
Else
MsgBox "信息库中无此商品!"
End If
Else
MsgBox "主键不能为空!"
End If
End Sub
Private Sub cmdEnd_Click()
Unload Me
End Sub
Private Sub cmdModify_Click()
'修改
If Trim(Me.txtJob.Text) <> "" And Trim(Me.dtpInput.Value) <> "" And Trim(Me.txtNo.Text) <> "" Then
Sql = "select * from 入库表 where 商品编号=" & Trim(Me.txtNo.Text)
Sql = Sql & " and 入库时间='" & Trim(Me.dtpInput.Value)
Sql = Sql & "' and 入库批次=" & Trim(Me.txtJob.Text)
Set RS = dbSelect(Sql)
If Not RS.EOF Then
Sql = "update 入库表 set 数量=" & Trim(Me.txtSum.Text)
Sql = Sql & " where 商品编号=" & Trim(Me.txtNo.Text)
Sql = Sql & " and 入库时间='" & Trim(Me.dtpInput.Value)
Sql = Sql & "' and 入库批次=" & Trim(Me.txtJob.Text)
dbOperate Sql
Else
MsgBox "信息库中无此商品!"
End If
Else
MsgBox "主键不能为空!"
End If
End Sub
Private Sub txtJob_KeyPress(KeyAscii As Integer)
'批次
If Not IsNumeric(Trim(Me.txtJob.Text)) And Trim(Me.txtJob.Text) <> "" Then
MsgBox "请输入数字!"
End If
End Sub
Private Sub txtSum_KeyPress(KeyAscii As Integer)
'数量
If Not IsNumeric(Trim(Me.txtSum.Text)) And Trim(Me.txtSum.Text) <> "" Then
MsgBox "请输入数字!"
End If
End Sub
Private Sub txtNo_KeyPress(KeyAscii As Integer)
'商品编号
If Not IsNumeric(Trim(Me.txtNo.Text)) And Trim(Me.txtNo.Text) <> "" Then
MsgBox "请输入数字!"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -