📄 原料管理-信息输入.frm
字号:
VERSION 5.00
Begin VB.Form Form11
Caption = "原料管理-信息输入"
ClientHeight = 6855
ClientLeft = 60
ClientTop = 345
ClientWidth = 10575
LinkTopic = "Form11"
ScaleHeight = 6855
ScaleWidth = 10575
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "保存信息"
Height = 375
Left = 2880
TabIndex = 7
Top = 5520
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "信息重填"
Height = 375
Left = 5280
TabIndex = 6
Top = 5520
Width = 1335
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "系统数据库.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 2760
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "原料管理信息"
Top = 6480
Visible = 0 'False
Width = 6135
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 7920
TabIndex = 5
Top = 5520
Width = 1215
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2400
TabIndex = 4
Top = 720
Width = 2295
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2400
TabIndex = 3
Top = 1800
Width = 2295
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7320
TabIndex = 2
Top = 1800
Width = 2295
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 2400
TabIndex = 1
Top = 2880
Width = 7335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7320
TabIndex = 0
Top = 720
Width = 2295
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "原料编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 12
Top = 840
Width = 1200
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "原料名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 5640
TabIndex = 11
Top = 840
Width = 1200
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "原料价格:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 10
Top = 1920
Width = 1200
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "原料数量:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 5640
TabIndex = 9
Top = 1920
Width = 1080
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "备 注:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 8
Top = 3120
Width = 1080
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim db As Database, rs As Recordset
Set db = OpenDatabase(App.Path + "/系统数据库.mdb")
Set rs = db.OpenRecordset("原料管理信息", dbOpenTable)
If Text1.Text = "" And Text2.Text = "" And Text3.Text = "" And Text4.Text = "" And Text5.Text = "" Then
MsgBox "记录不能为空!", vbOKOnly + vbCritical, "提示"
Else
Text1.SetFocus
rs.AddNew
rs.Fields(0).Value = Text1.Text
rs.Fields(1).Value = Text2.Text
rs.Fields(2).Value = Text3.Text
rs.Fields(3).Value = Text4.Text
rs.Fields(4).Value = Text5.Text
rs.Update
MsgBox "信息输入成功!", vbOKOnly, "恭喜"
rs.Fields.Refresh
Form2.Show
Me.Hide
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Form5
Me.Hide
Form2.Show
End Sub
Private Sub Form11_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -