📄 main_gzgl_kqgl.frm
字号:
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "员工姓名"
Caption = "员工姓名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "出勤天数"
Caption = "出勤天数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "请假天数"
Caption = "请假天数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "迟到或早退次数"
Caption = "迟到或早退次数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column06
DataField = "旷工天数"
Caption = "旷工天数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column07
DataField = "加班次数"
Caption = "加班次数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
MarqueeStyle = 4
BeginProperty Column00
ColumnWidth = 1289.764
EndProperty
BeginProperty Column01
ColumnWidth = 915.024
EndProperty
BeginProperty Column02
ColumnWidth = 1365.165
EndProperty
BeginProperty Column03
ColumnWidth = 975.118
EndProperty
BeginProperty Column04
ColumnWidth = 854.929
EndProperty
BeginProperty Column05
ColumnWidth = 1365.165
EndProperty
BeginProperty Column06
ColumnWidth = 794.835
EndProperty
BeginProperty Column07
ColumnWidth = 989.858
EndProperty
EndProperty
End
End
Attribute VB_Name = "main_gzgl_kqgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Form_Activate()
If sql1 <> "" Then
Adodc1.RecordSource = "select * from " & sql1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Else
MsgBox "没有找到符合条件的记录!", , "提示窗口"
End If
End If
End Sub
Private Sub Form_Load()
Me.Caption = text
Adodc1.RecordSource = "select * from 考勤表 where 考勤表.所属工资月份=(select 月份 from 月份表)"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Else
Cnn.Execute ("insert into 考勤表(员工编号,员工姓名) select 编号,姓名 from 人事表")
Cnn.Execute ("update 考勤表 set 所属工资月份=月份 from 月份表 where 所属工资月份 is null")
Adodc1.Refresh
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sql1 = ""
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "all"
If Toolbar1.Buttons(1).Caption = "当前月份" Then
Toolbar1.Buttons(1).Caption = "所有月份"
Else
Toolbar1.Buttons(1).Caption = "当前月份"
End If
If Toolbar1.Buttons(1).Caption = "所有月份" Then
Adodc1.RecordSource = "select * from 考勤表 order by 所属工资月份,员工编号"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from 考勤表 where 考勤表.所属工资月份=(select 月份 from 月份表)"
Adodc1.Refresh
End If
Case "modify"
If Adodc1.Recordset.RecordCount > 0 Then
Load main_gzgl_kqgl_lr
main_gzgl_kqgl_lr.Show 1
Else
MsgBox "系统没有要修改的数据!", , "提示窗口"
End If
Case "modifyall"
If Adodc1.Recordset.RecordCount > 0 Then
Load main_gzgl_kqgl_pl
main_gzgl_kqgl_pl.Show 1
Else
MsgBox "系统没有要修改的数据!", , "提示窗口"
End If
Case "find"
tb1 = "考勤表"
Load main_fzfind
main_fzfind.Show 1
Case "excel"
Dim r As Integer, c As Integer
Dim newxls As Excel.Application
Dim newbook As Excel.Workbook
Dim newsheet As Excel.Worksheet
Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
Set newbook = newxls.Workbooks.Add '创建工作簿
Set newsheet = newbook.Worksheets(1) '创建工作表
If sql1 <> "" Then
Adodc1.RecordSource = sql1
Adodc1.Refresh
End If
If Adodc1.Recordset.RecordCount > 0 Then
newxls.Visible = True
For i = 0 To DataGrid1.Columns.Count - 1
newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
Next i
'指定表格内容
Adodc1.Recordset.MoveFirst
Do Until Adodc1.Recordset.EOF
r = Adodc1.Recordset.AbsolutePosition
For c = 0 To DataGrid1.Columns.Count - 1
newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
Next c
Adodc1.Recordset.MoveNext
Loop
ErrSave:
Exit Sub
MsgBox Err.Description, , "提示窗口"
End If
Case "close"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -