📄 frm_addemp.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_addEmp
BackColor = &H00FF8080&
Caption = "添加员工信息"
ClientHeight = 3240
ClientLeft = 60
ClientTop = 450
ClientWidth = 5760
LinkTopic = "Form1"
ScaleHeight = 3240
ScaleWidth = 5760
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 360
Top = 2760
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=CarSaleSys"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "CarSaleSys"
OtherAttributes = ""
UserName = "sa"
Password = "sa"
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 375
Left = 4440
TabIndex = 11
Top = 2760
Width = 975
End
Begin VB.CommandButton Cmd_add
Caption = "确定"
Height = 375
Left = 3000
TabIndex = 9
Top = 2760
Width = 975
End
Begin VB.TextBox txtindate
Appearance = 0 'Flat
Height = 375
Left = 4080
TabIndex = 2
Top = 240
Width = 1455
End
Begin VB.TextBox txtbirthdate
Appearance = 0 'Flat
Height = 375
Left = 1200
TabIndex = 5
Top = 1200
Width = 1455
End
Begin VB.TextBox txtsex
Appearance = 0 'Flat
Height = 375
Left = 1200
TabIndex = 3
Top = 720
Width = 1455
End
Begin VB.Frame Frame1
BackColor = &H00FFFFC0&
Caption = "员工信息"
Height = 2655
Left = 120
TabIndex = 0
Top = 0
Width = 5535
Begin VB.TextBox txtaddr
Appearance = 0 'Flat
Height = 375
Left = 1080
TabIndex = 8
Top = 2160
Width = 4335
End
Begin VB.TextBox txttel
Appearance = 0 'Flat
Height = 375
Left = 1080
TabIndex = 7
Top = 1680
Width = 4335
End
Begin VB.TextBox txtEmpname
Appearance = 0 'Flat
Height = 375
Left = 1080
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.TextBox txttitle
Appearance = 0 'Flat
Height = 375
Left = 3960
TabIndex = 6
Top = 1200
Width = 1455
End
Begin VB.TextBox txtdepart
Appearance = 0 'Flat
Height = 375
Left = 3960
TabIndex = 4
Top = 720
Width = 1455
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "住址"
Height = 195
Index = 9
Left = 240
TabIndex = 18
Top = 2280
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "电话"
Height = 180
Index = 8
Left = 240
TabIndex = 17
Top = 1800
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "职务"
Height = 180
Index = 6
Left = 3000
TabIndex = 16
Top = 1320
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "所在部门"
Height = 195
Index = 5
Left = 2880
TabIndex = 15
Top = 840
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "进入公司时间"
Height = 195
Index = 4
Left = 2760
TabIndex = 14
Top = 360
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "生日"
Height = 180
Index = 1
Left = 240
TabIndex = 13
Top = 1320
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性别"
Height = 180
Index = 2
Left = 240
TabIndex = 12
Top = 840
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "姓名"
Height = 180
Index = 0
Left = 240
TabIndex = 10
Top = 360
Width = 360
End
End
End
Attribute VB_Name = "Frm_addEmp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()
Dim txtId As Integer
Adodc1.RecordSource = "SELECT * FROM Staff Order by Staff_id desc"
Adodc1.Refresh
If Adodc1.Recordset.EOF = True Then
txtId = 1
Else
txtId = Adodc1.Recordset.Fields(0) + 1
End If
If txtEmpname = "" Then
MsgBox ("请输入员工名字")
Exit Sub
End If
If txtsex = "" Then
MsgBox ("请输入员工性别")
Exit Sub
End If
If txtindate = "" Then
MsgBox ("请输入进入公司时间")
Exit Sub
End If
'增加新车
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0).Value = Val(txtId)
Adodc1.Recordset.Fields(1).Value = Trim(txtEmpname.Text)
Adodc1.Recordset.Fields(2).Value = Trim(txtsex.Text)
Adodc1.Recordset.Fields(3).Value = CDate(Trim(txtbirthdate.Text))
Adodc1.Recordset.Fields(4).Value = CDate(Trim(txtindate.Text))
Adodc1.Recordset.Fields(5).Value = Trim(txtdepart.Text)
Adodc1.Recordset.Fields(6).Value = Trim(txttitle.Text)
Adodc1.Recordset.Fields(7).Value = Trim(txttel.Text)
Adodc1.Recordset.Fields(8).Value = Trim(txtaddr.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
MsgBox "员工信息增加完成"
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -