📄 form1.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form ruku_dengji
Caption = "入库登记"
ClientHeight = 6030
ClientLeft = 60
ClientTop = 750
ClientWidth = 9420
LinkTopic = "Form1"
ScaleHeight = 6030
ScaleWidth = 9420
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command5
BackColor = &H80000015&
Caption = "商品管理"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 20
Top = 5280
Width = 1935
End
Begin VB.CommandButton Command4
Caption = "仓库管理"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3000
TabIndex = 19
Top = 5280
Width = 2295
End
Begin VB.CommandButton Command3
Caption = "系统管理"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5760
TabIndex = 18
Top = 5280
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 5160
TabIndex = 16
Top = 4440
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 2520
TabIndex = 15
Top = 4440
Width = 1215
End
Begin VB.Frame frame2
Caption = "备注"
Height = 3975
Left = 4320
TabIndex = 13
Top = 240
Width = 4935
Begin VB.TextBox Text8
Height = 3615
Left = 120
TabIndex = 14
Top = 240
Width = 4695
End
End
Begin VB.Frame Frame1
Caption = "请填写货物信息"
Height = 4215
Left = 0
TabIndex = 0
Top = 0
Width = 3975
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 22
Text = "类型"
Top = 1440
Width = 1095
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1080
TabIndex = 17
Top = 3120
Width = 2295
_ExtentX = 4048
_ExtentY = 661
_Version = 393216
Format = 73072641
CurrentDate = 38653
End
Begin VB.TextBox Text6
Height = 390
Left = 1080
TabIndex = 5
Top = 3720
Width = 2535
End
Begin VB.TextBox Text5
Height = 375
Left = 1080
TabIndex = 4
Top = 2520
Width = 2535
End
Begin VB.TextBox Text4
Height = 375
Left = 1080
TabIndex = 3
Top = 1920
Width = 2535
End
Begin VB.TextBox Text2
Height = 375
Left = 1080
TabIndex = 2
Top = 840
Width = 2535
End
Begin VB.TextBox Text1
Height = 375
Left = 1080
TabIndex = 1
Top = 240
Width = 2535
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "入库时间"
Height = 180
Left = 240
TabIndex = 12
Top = 3120
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "总 价"
Height = 180
Left = 240
TabIndex = 11
Top = 3720
Width = 630
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "货物数量"
Height = 180
Left = 240
TabIndex = 10
Top = 2640
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "单 价"
Height = 180
Left = 240
TabIndex = 9
Top = 2040
Width = 630
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "商品类型"
Height = 180
Left = 240
TabIndex = 8
Top = 1440
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "货物名称"
Height = 180
Left = 120
TabIndex = 7
Top = 840
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "货物编号"
Height = 180
Left = 120
TabIndex = 6
Top = 360
Width = 720
End
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Height = 735
Left = 120
TabIndex = 21
Top = 5160
Width = 8295
End
Begin VB.Menu ru_guanli
Caption = "入库管理"
Begin VB.Menu ru_dengji
Caption = "入库登记"
End
Begin VB.Menu ru_liulan
Caption = "入库浏览"
End
End
Begin VB.Menu chu_guanli
Caption = "出库管理"
Begin VB.Menu chu_dengji
Caption = "出库登记"
End
Begin VB.Menu chu_liulan
Caption = "出库浏览"
End
End
Begin VB.Menu cun_guanli
Caption = "库存管理"
Begin VB.Menu cun_chaxun
Caption = "库存查询"
End
Begin VB.Menu cun_gengxin
Caption = "库存更新"
End
Begin VB.Menu cun_shanchu
Caption = "库存删除"
End
End
End
Attribute VB_Name = "ruku_dengji"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chu_dengji_Click()
chuku_dengji.Show
Unload Me
End Sub
Private Sub chu_liulan_Click()
chuku_liulan.Show
Unload Me
End Sub
Private Sub Command1_Click()
Dim rs_addlab As New ADODB.Recordset
Dim sql As String
Dim sumprice As String
If Trim(Text1.Text) = "" Then
MsgBox "货物编号不能为空", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "货物名不能为空", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Combo1.Text) = "" Then
MsgBox "类型不能为空", vbOKOnly + vbExclamation, ""
Combo1.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "单价不能为空", vbOKOnly + vbExclamation, ""
Text4.SetFocus
Exit Sub
End If
If Trim(Text5.Text) = "" Then
MsgBox "数量不能为空", vbOKOnly + vbExclamation, ""
Text5.SetFocus
Exit Sub
End If
sumprice = Text5.Text * Text4.Text
Text6.Text = sumprice
Text6.Refresh
If Not IsDate(DTPicker1.Value) Then
MsgBox "请按照 yyyy-mm-dd 格式输入日期", vbOKOnly + vbExclamation, ""
DTPicker1.Value.SetFocus
Exit Sub
End If
If Trim(Text8.Text) = "" Then
MsgBox "备注不能为空", vbOKOnly + vbExclamation, ""
Text8.SetFocus
Exit Sub
End If
sql = "select * from 入库信息 where 货物编号='" & Text1.Text & "'"
rs_addlab.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_addlab.EOF Then
rs_addlab.AddNew
rs_addlab.Fields(0) = Trim(Text1.Text)
rs_addlab.Fields(1) = Trim(Text2.Text)
rs_addlab.Fields(2) = Trim(Combo1.Text)
rs_addlab.Fields(3) = Trim(Text4.Text)
rs_addlab.Fields(4) = Trim(Text5.Text)
rs_addlab.Fields(5) = Trim(Text6.Text)
rs_addlab.Fields(6) = Trim(DTPicker1.Value)
rs_addlab.Fields(7) = Trim(Text8.Text)
rs_addlab.Update
rs_addlab.Close
Else
Text1.SetFocus
Text1.Text = ""
rs_addlab.Close
End If
Dim rs_addlab1 As New ADODB.Recordset
Dim sql1 As String
sql1 = "select * from 库存信息 where 货物编号='" & Text1.Text & "'"
rs_addlab1.Open sql1, conn, adOpenKeyset, adLockPessimistic
If rs_addlab1.EOF Then
rs_addlab1.AddNew
rs_addlab1.Fields(0) = Trim(Text1.Text)
rs_addlab1.Fields(1) = Trim(Text2.Text)
rs_addlab1.Fields(2) = Trim(Combo1.Text)
rs_addlab1.Fields(3) = Trim(Text4.Text)
rs_addlab1.Fields(4) = Trim(Text5.Text)
rs_addlab1.Fields(5) = Trim(Text6.Text)
rs_addlab1.Fields(6) = Trim(Text8.Text)
rs_addlab1.Update
MsgBox "入库登记成功", vbOKOnly + vbInformation, "完成"
rs_addlab1.Close
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Else
MsgBox "货物编号重复!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
rs_addlab1.Close
Exit Sub
End If
Frame1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
gengxinmima.Show
Unload Me
End Sub
Private Sub Command4_Click()
ruku_dengji.Show
End Sub
Private Sub Command5_Click()
shangpin_luru.Show
Unload Me
End Sub
Private Sub cun_chaxun_Click()
kucun_chaxun.Show
Unload Me
End Sub
Private Sub cun_gengxin_Click()
kucun_gengxin.Show
Unload Me
End Sub
Private Sub cun_shanchu_Click()
kucun_shanchu.Show
Unload Me
End Sub
Private Sub Form_Load()
Dim rs_leibie As New ADODB.Recordset
Dim sql As String
sql = "select * from 商品类型"
rs_leibie.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_leibie.MoveFirst
Do While Not rs_leibie.EOF
Combo1.AddItem rs_leibie.Fields(0)
rs_leibie.MoveNext
Loop
rs_leibie.Close
End Sub
Private Sub ru_dengji_Click()
ruku_dengji.Show
End Sub
Private Sub ru_liulan_Click()
ruku_liulan.Show
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -