📄 +i
字号:
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "帮助"
Key = "bz"
ImageKey = "bz"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "fh"
ImageKey = "tc"
EndProperty
EndProperty
BorderStyle = 1
Begin MSComctlLib.Toolbar GsToolbar
Height = 540
Left = 9720
TabIndex = 6
Top = 0
Width = 1695
_ExtentX = 2990
_ExtentY = 953
ButtonWidth = 1455
ButtonHeight = 953
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 2
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存格式"
Key = "bcgs"
ImageKey = "bcgs"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "默认列宽"
Key = "hfmrgs"
ImageKey = "mrlk"
EndProperty
EndProperty
End
End
Begin VB.Label Lab_OperStatus
BackColor = &H000080FF&
Caption = "1"
Height = 345
Left = 10980
TabIndex = 5
Top = 1590
Visible = 0 'False
Width = 345
End
End
Attribute VB_Name = "Attend_FrmInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************************************************************************
'* 模 块 名 称 :考勤录入
'* 功 能 描 述 :以增行式的录入方式录入人员考勤
'* 程序员姓名 :田建秀
'* 最后修改人 :田建秀
'* 最后修改时间:2001/12/25
'* 备 注:程序中所有依实际情况自定义部分均用[>> <<]括起,注意此种录入需要修改"Sub Scdqfl"
'*
'* 1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
'*
'* 3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) 1-浏览 2-修改
'**************************************************************************************************
'以下为自定义变量
'其它固定使用变量
Dim Tsxx As String '系统信息提示(Fixed)
Dim ReportTitle As String '报表主标题(Fixed)
Dim Rsc As New ADODB.Recordset
Dim i As Long
Dim Sql As String
Dim FieldName()
Dim MonthD As Integer '本月的天数
'以下为固定使用变量(网格)
Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
Dim GridCode As String '显示网格网格代码
Dim GridInf() As Variant '整个网格设置信息
Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
Dim Sfxshjwg As Boolean '是否显示合计网格
Dim Qslz As Long '网格隐藏(非操作显示)列数
Dim Sjhgd As Double '网格数据行高度
Dim GridBoolean() As Boolean '网格列信息(布尔型)
Dim GridStr() As String '网格列信息(字符型)
Dim GridInt() As Integer '网格列信息(整型)
Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
Dim Dqlrwgh As Long '当前录入数据网格行
Dim Dqlrwgl As Long '当前录入数据网格列
Dim Dqlkwgh As Long '刚刚离开网格行(不一定为录入行)
Dim Dqlkwgl As Long '刚刚离开网格列
Dim Dqtoprow As Long '当前录入状态时最上端可视行
Dim Dqleftcol As Long '当前录入状态时最左端可视列
Dim Zdlrqnr As String '字段录入修改前内容(用来判断内容是否修改)
Dim Wbkbhlock As Boolean '文本框改变值锁
Dim Changelock As Boolean '网格行列改变控制锁(用来区别用户改变.程序改变)
Dim Gdtlock As Boolean '滚动条滚动控制(用来区别用户改变.程序改变)
Dim Yxxpdlock As Boolean '字段有效性判断锁(内容不修改不需进行字段有效性判断)
Dim Hyxxpdlock As Boolean '行有效性判断锁(字段内容不修改不需进行行有效性判断)
Dim Valilock As Boolean '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
Dim Shsfts As Boolean '删除记录行是否提示
Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
Private Sub Form_KeyPress(KeyAscii As Integer) '控制焦点转移和限制录入字符"'"
Select Case KeyAscii
Case 39 '屏蔽字符"'"
KeyAscii = 0
End Select
End Sub
Private Sub Form_Load() '窗 体 装 入
'初始化各种锁值(Fixed)
Changelock = False '网格行列改变控制锁
Gdtlock = False '滚动条滚动控制
Yxxpdlock = True '字段有效性判断锁
Hyxxpdlock = True '行有效性判断锁
Wbkbhlock = False '文本框内容改变锁
GsToolbar.Visible = False
'报表主标题及报表编码(Fixed)
ReportTitle = "人 员 考 勤"
XtReportCode = "PM_Attend"
Load Dyymctbl
Text1.Text = ""
'调 入 网 格(Fixed)
GridCode = "PM_Attend" '网格属性编码
Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
Qslz = GridInf(1)
Sjhgd = GridInf(2)
Pmbcsjhs = GridInf(3)
Fzxwghs = GridInf(4)
Sfblbzkd = GridInf(5)
Shsfts = GridInf(6)
Sfxshjwg = GridInf(7)
WglrGrid.TextMatrix(0, 0) = "*"
WglrGrid.TextMatrix(0, 1) = "职工ID号"
WglrGrid.TextMatrix(0, 2) = "部门编号"
'求小数位数
If Rsc.State = 1 Then Rsc.Close
Sql = "select * from Rs_Items where Sid=4 Order by ItemID"
Set Rsc = Cw_DataEnvi.DataConnect.Execute(Sql)
'填写数组
With Me.WglrGrid
.Cols = .Cols + Rsc.RecordCount
ReDim GridInt(.Cols - 1, 1 To 7)
ReDim GridBoolean(.Cols - 1, 1 To 7)
ReDim GridStr(.Cols - 1, 1 To 7)
ReDim FieldName(.Cols - 1)
FieldName(0) = "*"
FieldName(1) = "EmpId"
FieldName(2) = "DeptCode"
FieldName(3) = "DeptName"
FieldName(4) = "EmpNO"
FieldName(5) = "EmpName"
GridInt(4, 1) = 0
GridInt(4, 2) = 30
GridInt(4, 5) = 1
GridInt(4, 6) = 0
GridInt(4, 7) = 0
GridBoolean(4, 1) = True
GridBoolean(4, 2) = True
GridBoolean(4, 5) = True
GridStr(4, 1) = "003" '工号
GridStr(4, 2) = "工号不能空!"
GridStr(4, 3) = "PM_AttendHelp"
GridStr(4, 4) = "EmpNO"
For i = 3 To 5
GridStr(i, 1) = "00" & i - 1
Next
Do While Not Rsc.EOF
For i = .FixedCols + 2 To .Cols - 1
.TextMatrix(0, i) = Trim(Rsc!ChName)
FieldName(i) = Trim(Rsc!FieldName)
.ColAlignment(i) = 6
.FixedAlignment(i) = 4
GridInt(i, 1) = 5
GridInt(i, 2) = Val(Rsc!FieldLength)
GridInt(i, 3) = Val(Rsc!FieldLength) - Val(Rsc!FieldDotL)
GridInt(i, 4) = Val(Rsc!FieldDotL)
GridInt(i, 5) = 0
GridInt(i, 6) = 0
GridInt(i, 7) = 0
GridBoolean(i, 1) = True
GridBoolean(i, 2) = False
GridBoolean(i, 3) = False
GridBoolean(i, 4) = True
GridBoolean(i, 5) = True
GridBoolean(i, 6) = False
GridStr(i, 1) = "00" & i
GridStr(i, 2) = ""
GridStr(i, 3) = ""
GridStr(i, 4) = ""
GridStr(i, 5) = ""
Rsc.MoveNext
Next
Loop
End With
Szzls = WglrGrid.Cols - 1
'设置标题栏宽度、网格宽度高度(Fixed)
Pic_Title.Move 50, Pic_Title.Top, Me.Width - 150, Pic_Title.Height
WglrGrid.Move 50, Pic_Title.Top + Pic_Title.Height, Me.Width - 150
WglrGrid.Height = Me.Height - WglrGrid.Top - 380
Lbl_Date = "日期:" & KjYear & "年" & Period & "月"
'生成查询结果
Call Sub_Query
Call Et
'设置状态为修改状态
Lab_OperStatus = "2"
Lbl_Dept.Caption = "部门:" & Attend_FrmDept.DeptName
LblC
End Sub
Private Sub Et()
'决定text1是否可使用
With WglrGrid
If .Rows = .FixedRows + 1 Then
Text1.Enabled = False
Else
Text1.Enabled = True
End If
End With
End Sub
Private Sub Form_Unload(Cancel As Integer) '窗体卸载
'调入其它窗体或功能产生的有效性判断(包括数据回写)
If Not Fun_Drfrmyxxpd Then
Cancel = True
Exit Sub
End If
'卸载打印页面窗体
Unload Dyymctbl
End Sub
Private Sub Sub_Query() '生成查询结果
Dim Sqlstr As String '临时使用字符串
Dim RecTemp As New ADODB.Recordset '临时使用动态集
Dim jsqte As Long '临时计数器
'禁止网格刷新动作,为加快网格显示速度(Fixed)
WglrGrid.Redraw = False
'查询字符串
Sqlstr = "select p.*,r.EmpNO,r.EmpName,g.DeptName from Pm_AttendRecord p inner join Rs_BasicInfo r " & _
" on p.EmpID=r.EmpID inner join Gy_Department g on " & _
" g.DeptCode=p.DeptCode where p.DeptCode like '" & Attend_FrmDept.DeptCode & "%'" & _
" and KjYear=" & KjYear & " and Period=" & Period & " order by p.DeptCode,r.EmpNO "
Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
With RecTemp
WglrGrid.Rows = WglrGrid.FixedRows
jsqte = WglrGrid.FixedRows
Do While Not .EOF
WglrGrid.AddItem ""
WglrGrid.TextMatrix(jsqte, 0) = "*" '
WglrGrid.TextMatrix(jsqte, 1) = .Fields("EmpId") '职工ID号
WglrGrid.TextMatrix(jsqte, 2) = Trim(.Fields("DeptCode") & "") '部门编号
WglrGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "") '部门名称
WglrGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("EmpNO") & "") '工号
WglrGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = .Fields("EmpName") '姓名
For i = WglrGrid.FixedCols + 2 To WglrGrid.Cols - 1
If .Fields(FieldName(i)) <> 0 Then
WglrGrid.TextMatrix(jsqte, i) = .Fields(FieldName(i)) '考勤天数
End If
Next
'<<]
WglrGrid.RowHeight(jsqte) = Sjhgd
.MoveNext
jsqte = jsqte + 1
Loop
End With
'将网格刷新解禁(Fixed)
WglrGrid.Redraw = True
'调整网格(Fixed)
Call Sub_AdjustGrid
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim Srow As Long
If KeyAscii = 13 And Trim(Text1) <> "" Then
Srow = WglrGrid.Row + 1
Call Locate1(Trim(Text1.Text), Srow)
End If
End Sub
Private Sub Text1_Change()
Dim Srow As Long
If Trim(Text1) <> "" Then
Srow = WglrGrid.Row
Call Locate1(Trim(Text1.Text), Srow)
End If
End Sub
Private Sub Locate1(Emp As String, Srow As Long)
'定位 工号003,姓名004,SROw 开始行
Dim Find As Boolean
Dim Tlen As Integer
Dim j As Long
Find = False
Tlen = Len(Trim(Text1))
With WglrGrid
If Srow < .FixedRows Then
Srow = .FixedRows
End If
For i = Srow To .Rows - 2
If LCase(Mid(Trim(.TextMatrix(i, Sydz("003", GridStr(), Szzls))), 1, Tlen)) = LCase(Trim(Emp)) Then
.Select i, 0
.TopRow = i
Find = True
Exit Sub
End If
Next
For i = .FixedRows To Srow - 1
If LCase(Mid(Trim(.TextMatrix(i, Sydz("003", GridStr(), Szzls))), 1, Tlen)) = LCase(Trim(Emp)) Then
.Select i, 0
.TopRow = i
Find = True
Exit Sub
End If
Next
'按姓名找
For i = Srow To .Rows - 2
If LCase(Mid(Trim(.TextMatrix(i, Sydz("004", GridStr(), Szzls))), 1, Tlen)) = LCase(Trim(Emp)) Then
.Select i, 0
.TopRow = i
Find = True
Exit Sub
End If
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -