📄 jibenxinxi.frm
字号:
Begin VB.Label Label4
Caption = "性别:"
Height = 255
Left = 240
TabIndex = 5
Top = 1440
Width = 495
End
Begin VB.Label Label3
Caption = "部门:"
Height = 255
Left = 240
TabIndex = 4
Top = 1080
Width = 495
End
Begin VB.Label Label2
Caption = "姓名:"
Height = 255
Left = 240
TabIndex = 3
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "编号:"
Height = 255
Left = 240
TabIndex = 2
Top = 360
Width = 495
End
End
End
Attribute VB_Name = "jibenxinxi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() 'OK
Dim db As Database
Dim rs As Recordset
On Error Resume Next
Set db = OpenDatabase(App.Path & "\员工基本信息")
Set rs = db.OpenRecordset("员工基本信息")
While (rs.EOF = False)
If Text1.Text = "" Then
MsgBox "编号不能为空!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "姓名不能为空!"
Exit Sub
End If
If rs.Fields(0) = Text1.Text Then
MsgBox "注意,编号重复!", vbOKOnly + vbExclamation, "警告!"
Exit Sub
Else
rs.MoveNext
End If
If Text4.Text = "" Then
MsgBox "出生日期不能为空!"
Exit Sub
End If
If Text4.Text <> "" Then
If Not IsDate(Text4) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Text4.Text = ""
Exit Sub
Else
Text4 = Format(Text4, "yyyy-mm-dd")
End If
End If
If Text8.Text <> "" Then
If Not IsDate(Text8) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text8.SetFocus
Text8.Text = ""
Exit Sub
Else
Text8 = Format(Text8, "yyyy-mm-dd")
End If
End If
If Text9.Text <> "" Then
If Not IsDate(Text9) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text9.SetFocus
Text9.Text = ""
Exit Sub
Else
Text9 = Format(Text9, "yyyy-mm-dd")
End If
End If
If Text10.Text <> "" Then
If Not IsDate(Text10) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text10.SetFocus
Text10.Text = ""
Exit Sub
Else
Text10 = Format(Text10, "yyyy-mm-dd")
End If
End If
If Text11.Text <> "" Then
If Not IsDate(Text11) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text11.SetFocus
Text11.Text = ""
Exit Sub
Else
Text11 = Format(Text11, "yyyy-mm-dd")
End If
End If
If Text13.Text <> "" Then
If Not IsDate(Text13) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text13.SetFocus
Text13.Text = ""
Exit Sub
Else
Text13 = Format(Text13, "yyyy-mm-dd")
End If
End If
If Text14.Text <> "" Then
If Not IsDate(Text14) Then
MsgBox "时间应输入日期(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text14.SetFocus
Text14.Text = ""
Exit Sub
Else
Text14 = Format(Text14, "yyyy-mm-dd")
End If
End If
Wend
rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text20.Text
rs.Fields(4) = Text4.Text
rs.Fields(5) = Text5.Text
rs.Fields(6) = Text6.Text
rs.Fields(7) = Text7.Text
rs.Fields(8) = Text8.Text
rs.Fields(9) = Text9.Text
rs.Fields(10) = Text10.Text
rs.Fields(11) = Text11.Text
rs.Fields(12) = Text12.Text
rs.Fields(13) = Text13.Text
rs.Fields(14) = Text14.Text
rs.Fields(15) = Text15.Text
rs.Fields(16) = Text16.Text
rs.Fields(17) = Text17.Text
rs.Fields(18) = Text18.Text
rs.Fields(19) = Text19.Text
rs.Update
MsgBox "添加用户成功!", vbOKOnly + vbExclamation, "添加用户!"
rs.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
End Sub
Private Sub Command2_Click()
Dim db As Database
Dim rs As Recordset
Dim a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, X, Y, z As String * 50
On Error Resume Next
Set db = OpenDatabase(App.Path & "\员工基本信息")
Set rs = db.OpenRecordset("员工基本信息")
If Text1.Text = "" Then
MsgBox "要修改的员工编号没填!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "要修改的员工姓名没填!"
Exit Sub
End If
Set rs = db.OpenRecordset("select 编号,姓名 from 员工基本信息 where 编号='" & Text1.Text & "' and 姓名='" & Text2.Text & "'")
If rs.EOF = True And rs.BOF = True Then
a = MsgBox("员工的信息错误,请检验编号和姓名!", vbOKCancel)
Exit Sub
Else
If Text3.Text <> "" Then
b = "update 员工基本信息 set 部门='" & Text3.Text & "' where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute b
If Text20.Text <> "" Then
c = "update 员工基本信息 set 性别='" & Text20.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute c
If Text4.Text <> "" Then
d = "update 员工基本信息 set 生日='" & Text4.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute d
If Text5.Text <> "" Then
e = "update 员工基本信息 set 籍贯='" & Text5.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute e
If Text6.Text <> "" Then
f = "update 员工基本信息 set 学历='" & Text6.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute f
If Text7.Text <> "" Then
g = "update 员工基本信息 set 专业='" & Text7.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute g
If Text8.Text <> "" Then
h = "update 员工基本信息 set 参加工作时间='" & Text8.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute h
If Text9.Text <> "" Then
i = "update 员工基本信息 set 进入公司时间='" & Text9.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute i
If Text10.Text <> "" Then
j = "update 员工基本信息 set 起薪时间='" & Text10.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute j
If Text11.Text <> "" Then
k = "update 员工基本信息 set 调入部门时间='" & Text11.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute k
If Text12.Text <> "" Then
m = "update 员工基本信息 set 职称='" & Text12.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute m
If Text13.Text <> "" Then
n = "update 员工基本信息 set 职称时间='" & Text13.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute n
If Text14.Text <> "" Then
o = "update 员工基本信息 set 入党时间='" & Text14.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute o
If Text15.Text <> "" Then
p = "update 员工基本信息 set 档号='" & Text15.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute p
If Text16.Text <> "" Then
q = "update 员工基本信息 set 原身份='" & Text16.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute q
If Text17.Text <> "" Then
r = "update 员工基本信息 set 原职务='" & Text17.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute r
If Text18.Text <> "" Then
s = "update 员工基本信息 set 原工作单位='" & Text18.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute s
If Text19.Text <> "" Then
t = "update 员工基本信息 set 备注='" & Text19.Text & "'where 编号='" & Text1.Text & "'and 姓名='" & Text2.Text & "'"
db.Execute t
MsgBox "员工信息修改成功!"
rs.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Else
MsgBox "备注被填,没有写无!"
End If
Else
MsgBox "原工作单位没写,如果没有写无!"
End If
Else
MsgBox "原职务没写,如果没有写无!"
End If
Else
MsgBox "原身份没写,如果没有写无!"
End If
Else
MsgBox "档号没写,如果没有写无!"
End If
Else
MsgBox "入党时间没写,如果不是党员写无!"
End If
Else
MsgBox "职称时间没写,如果没有写无!"
End If
Else
MsgBox "职称没写,没有写无!"
End If
Else
MsgBox "调入部门时间没写,没有写无!"
End If
Else
MsgBox "起薪时间没写,没有写无!"
End If
Else
MsgBox "进入公司时间没写,这项必须写!"
End If
Else
MsgBox "参加工作时间没写,这项必须写!"
End If
Else
MsgBox "专业没写,没有写无!"
End If
Else
MsgBox "学历没写,没有写无!"
End If
Else
MsgBox "籍贯没写,这项必须写!"
End If
Else
MsgBox "生日没写,这项必须写!"
End If
Else
MsgBox "性别没写,这项必须写!"
End If
End If
End If
End Sub
Private Sub Command4_Click()
jibenxinxi.Hide
jiudianneibuziliaocaidan.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -