教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 资格考试 >

管理信息系统课程设计人事档案管理(2)

来源:网络收集 时间:2026-09-11
导读: If Adodc1.Recordset.EOF Then MsgBox 没有符合条件的档案 , 请重新输入查询条件! Exit Sub End If End Sub Private Sub Command2_Click() '先给赋值为0 Adodc1.Refresh If Adodc1.Recordset.RecordCount = 0 Then

If Adodc1.Recordset.EOF Then

MsgBox "没有符合条件的档案 , 请重新输入查询条件!" Exit Sub End If End Sub

Private Sub Command2_Click() '先给赋值为0 Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then Text3.Text = 0 Else sum = 0

Adodc1.Recordset.MoveFirst

Do While Not Adodc1.Recordset.EOF '从开始一直到结尾,累加 sum = sum + 1

Adodc1.Recordset.MoveNext Loop

Text3.Text = Val(sum) '保存到text1中去 Adodc1.Recordset.MoveFirst Adodc1.Refresh End If End Sub

BH = "请输入要修改的员工编号" bc = "修改" If cx > 0 Then BHs = Text2.Text Else

MsgBox "未选中数据!!", vbOKOnly + vbExclamation, "" Exit Sub

BHs = "" End If

Form8.Show Me.Hide End Sub

Private Sub Command4_Click() If Adodc1.Recordset.EOF Then MsgBox "没有可输出的数据!" Exit Sub End If sum = 0

Adodc1.Recordset.MoveFirst

Do While Not Adodc1.Recordset.EOF '从开始一直到结尾,累加 sum = sum + 1

Adodc1.Recordset.MoveNext Loop

Text3.Text = Val(sum) '保存到text1中去 Adodc1.Recordset.MoveFirst Adodc1.Refresh

Dim SaveFile As String

Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet

Adodc1.RecordSource = "select * from 员工基本信息表 where 员工编号 like '%" & Text2.Text & "%' and 姓名 like '%" & Text1.Text & "%'and 婚姻状况 like '%" & Combo1.Text & "%'and 性别 like '%" & Combo6.Text & "%' and 职位 like '%" & Combo2.Text & "%' and 政治面貌 like '%" & Combo3.Text & "%' and 所在部门 like '%" & Combo5.Text & "%'and 学历 like '%" & Combo4.Text & "%' " Adodc1.Refresh

Set xlApp = CreateObject("Excel.Application") '创建EXCEL对象

Set xlBook = xlApp.Workbooks.Add '打开已经存在的EXCEL工件簿文件

xlApp.Visible = True '设置EXCEL对象可见(或不可见) Set xlSheet = xlBook.Worksheets("Sheet1") '设置活动工作表 xlSheet.Cells(1, 1) = "员工编号" xlSheet.Cells(1, 2) = "姓名" xlSheet.Cells(1, 3) = "年龄" xlSheet.Cells(1, 4) = "性别" xlSheet.Cells(1, 5) = "所在部门" xlSheet.Cells(1, 6) = "电话" xlSheet.Cells(1, 7) = "职位" xlSheet.Cells(1, 8) = "学历" xlSheet.Cells(1, 9) = "聘用时间" xlSheet.Cells(1, 10) = "离职时间" xlSheet.Cells(1, 11) = "婚姻状况" xlSheet.Cells(1, 12) = "政治面貌" xlSheet.Cells(1, 13) = "毕业学校" xlSheet.Cells(1, 14) = "籍贯" xlSheet.Cells(1, 15) = "民族" For j = 1 To sum

xlSheet.Cells(j + 1, 1) = Adodc1.Recordset.Fields(0) xlSheet.Cells(j + 1, 2) = Adodc1.Recordset.Fields(1)

xlSheet.Cells(j + 1, 3) = Adodc1.Recordset.Fields(2) xlSheet.Cells(j + 1, 4) = Adodc1.Recordset.Fields(3) xlSheet.Cells(j + 1, 5) = Adodc1.Recordset.Fields(4) xlSheet.Cells(j + 1, 6) = Adodc1.Recordset.Fields(5) xlSheet.Cells(j + 1, 7) = Adodc1.Recordset.Fields(6) xlSheet.Cells(j + 1, 8) = Adodc1.Recordset.Fields(7) xlSheet.Cells(j + 1, 9) = Adodc1.Recordset.Fields(8) xlSheet.Cells(j + 1, 10) = Adodc1.Recordset.Fields(9) xlSheet.Cells(j + 1, 11) = Adodc1.Recordset.Fields(10) xlSheet.Cells(j + 1, 12) = Adodc1.Recordset.Fields(11) xlSheet.Cells(j + 1, 13) = Adodc1.Recordset.Fields(12) xlSheet.Cells(j + 1, 14) = Adodc1.Recordset.Fields(13) xlSheet.Cells(j + 1, 15) = Adodc1.Recordset.Fields(14) Adodc1.Recordset.MoveNext Next

SaveFile = "d:\1.xls" '你可以在此修改保存的文件名称 If Dir(SaveFile) <> "" Then Kill SaveFile

xlBook.SaveAs FileName:=SaveFile '保存工作表,结束时一定别忘了保存

xlBook.Close (True) '关闭工作簿 这里的True表示退出时保存修改 xlApp.Quit '结束EXCEL对象

Set xlApp = Nothing '释放xlApp对象 MsgBox "文件已成功导出到" & SaveFile End Sub

Private Sub Command5_Click() Form3.Hide Form2.Show End Sub

Private Sub Form_Load()

Adodc1.RecordSource = "select * from 员工基本信息表 where 员工编号 like '%" & Text2.Text & "%' and 姓名 like '%" & Text1.Text & "%'and 婚姻状况 like '%" & Combo1.Text & "%'and 性别 like '%" & Combo6.Text & "%' and 职位 like '%" & Combo2.Text & "%' and 政治面貌 like '%" & Combo3.Text & "%' and 所在部门 like '%" & Combo5.Text & "%'and 学历 like '%" & Combo4.Text & "%' " Combo1.AddItem "已婚" Combo1.AddItem "未婚" Combo2.AddItem "总经理" Combo2.AddItem "副总经理" Combo2.AddItem "部长"

Combo2.AddItem "工程师" Combo2.AddItem "职工" Combo3.AddItem "党员" Combo3.AddItem "群众" Combo4.AddItem "本科" Combo4.AddItem "硕士" Combo4.AddItem "博士" Combo4.AddItem "高中" Combo5.AddItem "技术部" Combo5.AddItem "行政部" Combo5.AddItem "财务部" Combo5.AddItem "业务部" Combo6.AddItem "男" Combo6.AddItem "女"

Adodc1.ConnectionString = cnn.ConnectionString

Adodc1.RecordSource = "select * from 员工基本信息表" End Sub

四、档案添加界面

档案添加界面主要是添加员工档案。如果添加的档案已经存在,提示不能添加。

Private Sub Command1_Click()

If Text1.Text = "" Or Text2.Text = "" Then

MsgBox "员工编号或名称为空,请重新输入!" Exit Sub End If

If Label1.Caption = "员工档案修改" Then If Adodc1.Recordset.EOF = True Then

MsgBox "编号不存在无法修改", vbOKOnly + vbExclamation, "警告!"

Exit Sub End If

Dim Mag As Integer

Mag = MsgBox("是否修改!", vbYesNo, …… 此处隐藏:3778字,全部文档内容请下载后查看。喜欢就下载吧 ……

管理信息系统课程设计人事档案管理(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/91576.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)