📄 frmattinfo.frm
字号:
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
BeginProperty Column08
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 Column09
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
BeginProperty Column00
ColumnWidth = 824.882
EndProperty
BeginProperty Column01
ColumnWidth = 824.882
EndProperty
BeginProperty Column02
ColumnWidth = 840.189
EndProperty
BeginProperty Column03
ColumnWidth = 645.165
EndProperty
BeginProperty Column04
ColumnWidth = 689.953
EndProperty
BeginProperty Column05
ColumnWidth = 810.142
EndProperty
BeginProperty Column06
ColumnWidth = 794.835
EndProperty
BeginProperty Column07
ColumnWidth = 840.189
EndProperty
BeginProperty Column08
ColumnWidth = 794.835
EndProperty
BeginProperty Column09
ColumnWidth = 1379.906
EndProperty
EndProperty
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 375
Left = -6120
TabIndex = 1
Top = -3840
Width = 375
_ExtentX = 661
_ExtentY = 661
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
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 Column01
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
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmAttInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim conn As New ADODB.Connection
Dim connstr As String
Dim mysql As String
Private Sub Combo1_Click() '选择月份
'Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=database\企业工资管理系统.mdb;Persist Security Info=False'" '
'Adodc1.RecordSource = "select * from 考勤信息表 where 年份='" & Text1(3).Text & "'and 月份='" & Combo1.Text & "'"
'Adodc1.Refresh
rs.Close
mysql = "select * from 考勤信息表 where 年份=" & Text1(3).Text & " and 月份=" & Combo1.Text
'MsgBox mysql
rs.CursorLocation = adUseClient
rs.Open mysql, conn, adOpenKeyset, adLockPessimistic
'Set DataGrid2.DataSource = rs
Set rs = rs
Set DataGrid2.DataSource = rs
DataGrid2.Refresh
'Adodc1.Refresh
End Sub
Private Sub Command1_Click() '增加
rs.AddNew
'Text1(0).SetFocus
Command1.Enabled = False
Command2.Enabled = False
'Command3.Enabled = False
Command4.Enabled = True
'Command5.Enabled = True
Command7.Enabled = True
End Sub
Private Sub Command10_Click() '前翻
rs.MovePrevious
If rs.BOF = True Then
rs.MoveNext
MsgBox "已到达第一条记录!", vbOKOnly + vbExclamation, "警告"
End If
Command8.Enabled = True
Command9.Enabled = True
End Sub
Private Sub Command2_Click() '删除
If MsgBox("确定删除当前资料吗?", vbInformation + vbYesNo, "删除资料?") = vbYes Then
rs.Delete
rs.MoveFirst
End If
End Sub
'Private Sub Command3_Click() '修改
'Command1.Enabled = False
'Command2.Enabled = False
'Command3.Enabled = False
'Command4.Enabled = True
'Command5.Enabled = True
'Command7.Enabled = True
'End Sub
Private Sub Command4_Click() '保存
'For i = 0 To 9
' If Text1(i) = "" Then
' MsgBox "输入不完整!", vbOKOnly + vbExclamation, "警告"
' Text1(i).SetFocus
' Exit Sub
' End If
'Next i
If MsgBox("确定保存当前资料吗?", vbInformation + vbYesNo, "保存资料?") = vbYes Then
rs.Update
rs.MoveNext
End If
Command1.Enabled = True
Command2.Enabled = True
'Command3.Enabled = True
Command4.Enabled = False
'Command5.Enabled = True
Command7.Enabled = True
End Sub
'Private Sub Command5_Click() '取消
' If MsgBox(" 放弃当前的操作吗?", vbInformation + vbYesNo, "放弃?") = vbYes Then
' rs.CancelBatch adAffectAllChapters
' End If
' rs.MoveFirst
' Command1.Enabled = True
' Command2.Enabled = True
' Command3.Enabled = True
' Command4.Enabled = False
' Command5.Enabled = True
' Command7.Enabled = True
'
'End Sub
Private Sub Command6_Click() '首记录
rs.MoveFirst
Command1.Enabled = True
Command2.Enabled = True
'Command3.Enabled = True
Command4.Enabled = True
'Command5.Enabled = True
Command7.Enabled = True
Command6.Enabled = False
Command8.Enabled = True
Command9.Enabled = True
Command10.Enabled = False
End Sub
Private Sub Command7_Click() '返回
'Me.Hide
Unload Me
conn.Close
' Exit Sub
End Sub
Private Sub Command8_Click() '后翻
rs.MoveNext
If rs.EOF = True Then
rs.MovePrevious
MsgBox "已到达最后一条记录!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
Command6.Enabled = True
Command10.Enabled = True
End Sub
Private Sub Command9_Click() '末记录
rs.MoveLast
Command1.Enabled = True
Command2.Enabled = True
'Command3.Enabled = True
Command4.Enabled = True
'Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = False
Command9.Enabled = False
Command10.Enabled = True
End Sub
Private Sub Form_Load()
'rs.MoveFirst
Command1.Enabled = True
Command2.Enabled = True
'Command3.Enabled = True
Command4.Enabled = True
'Command5.Enabled = True
Command7.Enabled = True
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo1.AddItem "3"
Combo1.AddItem "4"
Combo1.AddItem "5"
Combo1.AddItem "6"
Combo1.AddItem "7"
Combo1.AddItem "8"
Combo1.AddItem "9"
Combo1.AddItem "10"
Combo1.AddItem "11"
Combo1.AddItem "12"
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database\企业工资管理系统.mdb;Persist Security Info=False"
conn.Open connstr
mysql = "select * from 考勤信息表"
rs.CursorLocation = adUseClient
rs.Open mysql, conn, adOpenKeyset, adLockPessimistic
Set DataGrid2.DataSource = rs
DataGrid2.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -