VB+Access员工信息管理系统
程序代码如下
Form2:
Public msg
Private Sub Command1_Click()
vb_msg = MsgBox("请输入新员工", vbOKCancel)
If vb_msg = vbCancel Then
Exit Sub
End If
data1.Recordset.AddNew
data1.Recordset.Fields("员工编号") = Text1.Text
data1.Recordset.Fields("员工姓名") = Text2.Text
data1.Recordset.Fields("性别") = Text3.Text
Dada1.Recordset.Fields("年龄") = Text4.Text
Dada1.Recordset.Fields("基本学历") = Text5.Text
Dada1.Recordset.Fields("政治面貌") = Text6.Text
Dada1.Recordset.Fields("所在城市") = Text7.Text
data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Dim areturn As Integer
areturn = MsgBox("你确实要删除员工记录吗?", vbYesNo)
If areturn = vbYes Then
data1.Recordset.Delete
data1.Recordset.MoveNext
If data1.Recordset.EOF Then
data1.Recordset.MoveLast
End If
End If
End Sub
Private Sub Command3_Click()
Dim areturn As Integer
areturn = MsgBox("你确实要修改员工信息吗?", vbYesNo)
If areturn = vbYes Then
data1.Recordset.Edit
data1.Recordset.Fields("员工编号") = Text1.Text
data1.Recordset.Fields("员工姓名") = Text2.Text
data1.Recordset.Fields("性别") = Text3.Text
Dada1.Recordset.Fields("年龄") = Text4.Text
Dada1.Recordset.Fields("基本学历") = Text5.Text
Dada1.Recordset.Fields("政治面貌") = Text6.Text
Dada1.Recordset.Fields("所在城市") = Text7.Text
data1.Recordset.Update
End If
End Sub
Private Sub Command4_Click()
msg = InputBox("请输入员工编号", "查找记录")
Data.recourdset.FindFirst "员工编号='" & msg & "'"
If data1.Recordset.NoMatch Then
MsgBox "没有符合条件的员工"
Else
MsgBox "符合条件的员工为" & data1.Recordset.Fields(1)
End If
End Sub
Private Sub Command5_Click()
data1.Recordset.MovePrevious
If data1.Recordset.BOF Then
data1.Recordset.MoveFirst
MsgBox ("已经是第一条记录了!")
End If
End Sub
Private Sub Command6_Click()
data1.Recordset.MoveNext
If data1.Recordset.EOF Then
MsgBox ("已经是最后一条记录了!")
End If
End Sub
Private Sub Command7_Click()
datareport1.Show
End Sub
Private Sub Command8_Click()
Form1.Show
Form2.Hide
End Sub
Form3:
Public msg
Private Sub Command1_Click()
vb_msg = MsgBox("请输入新部门信息", vbOKCancel)
If vb_msg = vbCancel Then
Exit Sub
End If
Data1.Recordset.AddNew
Data1.Recordset.Fields("部门编号") = Text1.Text
Data1.Recordset.Fields("部门名称") = Text2.Text
Data1.Recordset.Fields("职务名称") = Text3.Text
Dada1.Recordset.Fields("职称名称") = Text4.Text
Dada1.Recordset.Fields("负责人姓名") = Text5.Text
Dada1.Recordset.Fields("部门人数") = Text6.Text
Data1.Recordset.Update
End Sub
Private Sub Command1_Click()
vb_msg = MsgBox("请输入新部门信息", vbOKCancel)
If vb_msg = vbCancel Then
Exit Sub
End If
Data1.Recordset.AddNew
Data1.Recordset.Fields("部门编号") = Text1.Text
Data1.Recordset.Fields("部门名称") = Text2.Text
Data1.Recordset.Fields("职务名称") = Text3.Text
Dada1.Recordset.Fields("职称名称") = Text4.Text
Dada1.Recordset.Fields("负责人姓名") = Text5.Text
Dada1.Recordset.Fields("部门人数") = Text6.Text
Data1.Recordset.Update
End Sub
Private Sub Command2_Click()
Dim areturn As Integer
areturn = MsgBox("你确实要删除该部门记录吗?", vbYesNo)
If areturn = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
需要完整内容的请联系QQ752018766,本文免费,转发请注明源于www.751com.cn
If areturn = vbYes Then
Data1.Recordset.Edit
Data1.Recordset.Fields("部门编号") = Text1.Text
Data1.Recordset.Fields("部门名称") = Text2.Text
Data1.Recordset.Fields("职务名称") = Text3.Text
Dada1.Recordset.Fields("职称名称") = Text4.Text
Dada1.Recordset.Fields("负责人姓名") = Text5.Text
Dada1.Recordset.Fields("部门人数") = Text6.Text
Data1.Recordset.Update
End If
End Sub
上一页 [1] [2] [3] [4] [5] [6] 下一页