管理信息系统课程设计人事档案管理(2)
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字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [资格考试]石油钻采专业设备项目可行性研究报告编
- [资格考试]2012-2013学年度第二学期麻风病防治知
- [资格考试]道路勘测设计 绪论
- [资格考试]控烟戒烟知识培训资料
- [资格考试]建设工程安全生产管理(三类人员安全员
- [资格考试]photoshop制作茶叶包装盒步骤平面效果
- [资格考试]授课进度计划表封面(09-10下施工)
- [资格考试]麦肯锡卓越工作方法读后感
- [资格考试]2007年广西区农村信用社招聘考试试题
- [资格考试]软件实施工程师笔试题
- [资格考试]2014年初三数学复习专练第一章 数与式(
- [资格考试]中国糯玉米汁饮料市场发展概况及投资战
- [资格考试]塑钢门窗安装((专项方案)15)
- [资格考试]初中数学答题卡模板2
- [资格考试]2015-2020年中国效率手册行业市场调查
- [资格考试]华北电力大学学习实践活动领导小组办公
- [资格考试]溃疡性结肠炎研究的新进展
- [资格考试]人教版高中语文1—5册(必修)背诵篇目名
- [资格考试]ISO9001-2018质量管理体系最新版标准
- [资格考试]论文之希尔顿酒店集团进入中国的战略研
- 全国中小学生转学申请表
- 《奇迹暖暖》17-支2文学少女小满(9)公
- 2019-2020学年八年级地理下册 第六章
- 2005年高考试题——英语(天津卷)
- 无纺布耐磨测试方法及标准
- 建筑工程施工劳动力安排计划
- (目录)中国中央空调行业市场深度调研分
- 中国期货价格期限结构模型实证分析
- AutoCAD 2016基础教程第2章 AutoCAD基
- 2014-2015学年西城初三期末数学试题及
- 机械加工工艺基础(完整版)
- 归因理论在管理中的应用[1]0
- 突破瓶颈 实现医院可持续发展
- 2014年南京师范大学商学院决策学招生目
- 现浇箱梁支架预压报告
- Excel_2010函数图表入门与实战
- 人教版新课标初中数学 13.1 轴对称 (
- Visual Basic 6.0程序设计教程电子教案
- 2010北京助理工程师考试复习《建筑施工
- 国外5大医疗互联网模式分析




