📄 main_ygtj.frm
字号:
VERSION 5.00
Begin VB.Form main_ygtj
BackColor = &H00C0C0C0&
Caption = "添加员工信息"
ClientHeight = 4320
ClientLeft = 60
ClientTop = 345
ClientWidth = 7050
LinkTopic = "Form1"
ScaleHeight = 4320
ScaleWidth = 7050
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ygb"
Top = 2640
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton Command3
Caption = "关闭"
Height = 495
Left = 5400
TabIndex = 14
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3120
TabIndex = 13
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 600
TabIndex = 12
Top = 3240
Width = 1335
End
Begin VB.TextBox Text6
Height = 495
Left = 4920
TabIndex = 11
Top = 1920
Width = 1695
End
Begin VB.TextBox Text5
Height = 495
Left = 1320
TabIndex = 9
Top = 1920
Width = 1815
End
Begin VB.TextBox Text4
Height = 495
Left = 4920
TabIndex = 7
Top = 1080
Width = 1695
End
Begin VB.TextBox Text3
Height = 495
Left = 1320
TabIndex = 5
Top = 1080
Width = 1815
End
Begin VB.TextBox Text2
Height = 495
Left = 4920
TabIndex = 3
Top = 240
Width = 1695
End
Begin VB.TextBox Text1
Height = 495
Left = 1320
TabIndex = 0
Top = 240
Width = 1815
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "联系方式"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3720
TabIndex = 10
Top = 1920
Width = 1095
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "年龄"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 8
Top = 1920
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "职务"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3720
TabIndex = 6
Top = 1080
Width = 1095
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性别"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 4
Top = 1200
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3720
TabIndex = 2
Top = 240
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "员工号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 1
Top = 360
Width = 855
End
End
Attribute VB_Name = "main_ygtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Data1.Recordset.AddNew
Data1.Recordset.Fields("员工号") = Text1.Text
Data1.Recordset.Fields("姓名") = Text2.Text
Data1.Recordset.Fields("性别") = Text3.Text
Data1.Recordset.Fields("职务") = Text4.Text
Data1.Recordset.Fields("年龄") = Text5.Text
Data1.Recordset.Fields("联系方式") = Text6.Text
Data1.Recordset.Update '更新记录
Data1.Refresh
Text1.Text = "": Text2.Text = "": Text3.Text = ""
Text4.Text = "": Text5.Text = "": Text6.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = "": Text2.Text = "": Text3.Text = ""
Text4.Text = "": Text5.Text = "": Text6.Text = ""
End Sub
Private Sub Command3_Click()
main.Enabled = True
Unload Me
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db.MDB"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -