📄 frm_addsta.frm
字号:
VERSION 5.00
Begin VB.Form Frm_addSta
Caption = "增加员工信息"
ClientHeight = 4245
ClientLeft = 60
ClientTop = 375
ClientWidth = 7035
LinkTopic = "Form2"
ScaleHeight = 4245
ScaleWidth = 7035
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3840
TabIndex = 16
Top = 3360
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 1440
TabIndex = 15
Top = 3360
Width = 1575
End
Begin VB.Frame Frame1
Caption = "增加员工信息"
Height = 2535
Left = 480
TabIndex = 0
Top = 240
Width = 5895
Begin VB.TextBox txtStaffphone
Height = 270
Left = 1320
TabIndex = 14
Top = 2040
Width = 1095
End
Begin VB.TextBox txtStafftitle
Height = 390
Left = 3600
TabIndex = 13
Top = 1680
Width = 1455
End
Begin VB.TextBox txtStaffdepart
Height = 270
Left = 1320
TabIndex = 12
Top = 1560
Width = 1095
End
Begin VB.TextBox txtStaffage
Height = 375
Left = 3600
TabIndex = 11
Top = 1080
Width = 1575
End
Begin VB.TextBox txtStaffSex
Height = 270
Left = 1320
TabIndex = 10
Top = 1080
Width = 1095
End
Begin VB.TextBox txtStaff_Name
Height = 270
Left = 3600
TabIndex = 9
Top = 600
Width = 1575
End
Begin VB.TextBox txtStaff_Id
Height = 270
Left = 1320
TabIndex = 8
Top = 600
Width = 1095
End
Begin VB.Label Label7
Caption = "电话"
Height = 375
Left = 360
TabIndex = 7
Top = 2040
Width = 735
End
Begin VB.Label Label6
Caption = "职务"
Height = 255
Left = 2760
TabIndex = 6
Top = 1680
Width = 615
End
Begin VB.Label Label5
Caption = "所在部门"
Height = 375
Left = 360
TabIndex = 5
Top = 1560
Width = 855
End
Begin VB.Label Label4
Caption = "年龄"
Height = 375
Left = 2760
TabIndex = 4
Top = 1080
Width = 615
End
Begin VB.Label Label3
Caption = "性别"
Height = 375
Left = 360
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.Label Label2
Caption = "员工姓名"
Height = 255
Left = 2760
TabIndex = 2
Top = 600
Width = 855
End
Begin VB.Label Label1
Caption = "员工编号"
Height = 375
Left = 360
TabIndex = 1
Top = 600
Width = 975
End
End
End
Attribute VB_Name = "Frm_addSta"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim txtId As Integer
Adodcl.RecordSource = "select * from Staff Order by Staff_id desc"
Adodcl.Refresh
If Adodcl.Recordset.EOF = True Then
txtId = 1
Else
txtId = Adodcl.Recordset.Fields(0) + 1
End If
If txtStaff_Id.Text = "" Then
MsgBox ("请输入员工编号")
Exit Sub
End If
If txtStaff_Name.Text = "" Then
MsgBox ("请输入员工名称")
Exit Sub
End If
If txtStaffSex.Text = "" Then
MsgBox ("请输入性别")
Exit Sub
End If
If txtStaffdepart.Text = "" Then
MsgBox ("请输入性别")
Exit Sub
End If
Adodcl.Recordset.AddNew
Adodcl.Recordset.Fields(0).Value = Val(txtId)
Adodcl.Recordset.Fields(1) = Val(Trim(txtStaff_Id.Text))
Adodcl.Recordset.Fields(2) = Trim(txtStaff_Name.Text)
Adodcl.Recordset.Fields(3) = Trim(txtStaffSex.Text)
Adodcl.Recordset.Fields(4) = Val(Trim(txtStaffage.Text))
Adodcl.Recordset.Fields(5) = Trim(txtStaffdepart.Text)
Adodcl.Recordset.Fields(6) = Trim(txtStafftitle.Text)
Adodcl.Recordset.Fields(6) = Trim(txtStaffphone.Text)
Adodcl.Recordset.Update
Adodcl.Refresh
MsgBox ("部门信息增加完成")
Unload Me
End Sub
Private Sub Command2_Click()
Load FormMain
FormMain.Show
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -