📄 +i
字号:
end if
end sub
'==============================================================
sub saveInput()
moveflag=true
if rds1.Recordset.recordcount<=0 then
msgbox "没有找到满足条件的数据!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
if grid1.row > 1 then
grid1.row = grid1.row -1
else
'grid1.row =grid1.row - 1
rds1.Recordset.movenext
moveflag = false
end if
grid1.Editactive = False
On Error resume next
RDS1.SubmitChanges
If Err.Number <> 0 Then
'RDS1.CancelUpdate
MsgBox "无法更新数据!"
else
l_tag="0"
startno.value=""
End If
if moveflag then
grid1.Row=grid1+1
else
rds1.Recordset.moveprevious
end if
end sub
'==============================================================
sub cancelInput()
On Error Resume Next
RDS1.CancelUpdate
If Err.Number <> 0 Then
MsgBox "无法恢复原来数据!"
End If
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
Grid1.Rebind
end sub
'==============================================================
sub xhtotal()
if len(trim(weekstartno.value))=0 and (len(rtrim(monthstartno.value))=0 and len(rtrim(daystartno.value))=0) then
msgbox "对不起!请先输入第几周!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
if len(trim(classno.value))=0 and len(trim(startno.value))=0 then
msgbox "对不起!请先输入班号或学号!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
' if len(rtrim(monthstartno.value))> 0 then
' else
' msgbox "请输入月份!",,"提示窗口"
' start_input.disabled = false
' save_input.disabled = true
cancel_input.disabled = true
' exit sub
' end if
' if len(rtrim(daystartno.value))> 0 then
' else
' msgbox "请输入日!",,"提示窗口"
' start_input.disabled = false
' save_input.disabled = true
' cancel_input.disabled = true
' exit sub
' end if
if len(rtrim(monthstartno.value))>0 then
if len(rtrim(monthendno.value))> 0 then
else
msgbox "请输入结束月份!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
monthendno.value=monthstartno.value
exit sub
end if
end if
if len(rtrim(daystartno.value))>0 then
if len(rtrim(daysendno.value))> 0 then
else
msgbox "请输入结束日!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
daysendno.value = daystartno.value
exit sub
end if
end if
if len(rtrim(weekstartno.value)) > 0 then
if len(rtrim(weekendno.value)) > 0 then
if int(rtrim(weekendno.value)) < int(rtrim(weekstartno.value)) then
msgbox "终止周必须不小于起始周!"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
else
weekendno.value = weekstartno.value
end if
end if
if len(rtrim(weekstartno.value))=0 then
if isdate(yearno.value+"/"+monthstartno.value+"/"+daystartno.value) then
else
msgbox "对不起!此开始日期格式输入错误,请重新输入",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
EXIT SUB
end if
if isdate(endyearno.value+"/"+monthendno.value+"/"+daysendno.value) then
else
msgbox "对不起!此终止日期格式输入错误,请重新输入",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
EXIT SUB
end if
' msgbox cdate(rtrim(yearno.value +"/"+monthstartno.value+"/"+daystartno.value)) < cdate(rtrim(yearno.value +"/"+monthendno.value+"/"+daySendno.value))
if cdate(rtrim(yearno.value +"/"+monthstartno.value+"/"+daystartno.value)) > cdate(rtrim(endyearno.value +"/"+monthendno.value+"/"+daySendno.value)) then
msgbox "终止日期不能小于起始日期",,"提示窗口"
exit sub
end if
end if
if len(rtrim(startno.value)) > 0 then
if len(rtrim(endno.value)) > 0 then
if rtrim(endno.value) < rtrim(startno.value) then
msgbox "终止学号必须不小于起始学号!"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
else
endno.value = startno.value
end if
end if
' msgbox len(rtrim(weekstartno.value))
if len(rtrim(weekstartno.value))=0 then
datestart=rtrim(yearno.value +"/"+monthstartno.value+"/"+daystartno.value)
dateend=rtrim(endyearno.value +"/"+monthendno.value+"/"+daysendno.value)
else
end if
if len(trim(startno.value))<>0 then
if len(rtrim(weekstartno.value))>0 then
'rds1.SQL="select 班号,学号,姓名,请假=sum(请假),旷课=sum(旷课),迟到=sum(迟到),早退=sum(早退) from dailymanage where (学号>='"&startno.value&"' and 学号<='"&endno.value&"') and 第几周>='"&int(weekstartno.value)&"' and 第几周<='"&int(weekendno.value)&"'"&_
'"and convert(datetime,日期)>=convert(datetime,'"&datestart&"') and convert(datetime,日期)<=convert(datetime,'"&dateend&"') group by 班号,学号,姓名 "
'rds1.ExecuteOptions = 1
'rds1.Refresh
rds1.SQL="select 班号,学号,姓名,请假=sum(请假),旷课=sum(旷课),迟到=sum(迟到),早退=sum(早退) from dailymanage where (学号>='"&startno.value&"' and 学号<='"&endno.value&"') and convert(int,第几周)>="&int(weekstartno.value)&" and convert(int,第几周)<="&int(weekendno.value)&""&_
" and 学期='"&termno.value&"' group by 班号,学号,姓名 "
rds1.ExecuteOptions = 1
rds1.Refresh
if rds1.Recordset.recordcount<=0 then
msgbox "没有找到满足此条件的数据!",,"提示窗口"
exit sub
else
student_print.disabled = false
end if
else
rds1.SQL="select 班号,学号,姓名,请假=sum(请假),旷课=sum(旷课),迟到=sum(迟到),早退=sum(早退) from dailymanage where (学号>='"&startno.value&"' and 学号<='"&endno.value&"') and 学期='"&termno.value&"'"&_
"and convert(datetime,日期)>=convert(datetime,'"&datestart&"') and convert(datetime,日期)<=convert(datetime,'"&dateend&"') group by 班号,学号,姓名 "
rds1.ExecuteOptions = 1
rds1.Refresh
if rds1.Recordset.recordcount<=0 then
msgbox "没有找到满足此条件的数据!",,"提示窗口"
exit sub
else
student_print.disabled = false
end if
end if
else
msgbox "请输入学号!",,"提示窗口"
end if
end sub
'按班号进行统计
'==================================================================
sub bhtotal()
if len(trim(weekstartno.value))=0 and (len(rtrim(monthstartno.value))=0 and len(rtrim(daystartno.value))=0) then
msgbox "对不起!请先输入第几周!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
' if len(trim(classno.value))=0 and len(trim(startno.value))=0 then
' msgbox "对不起!请先输入班号或学号!",,"提示窗口"
' start_input.disabled = false
' save_input.disabled = true
' cancel_input.disabled = true
' exit sub
' end if
' if len(rtrim(monthstartno.value))> 0 then
' else
' msgbox "请输入月份!",,"提示窗口"
' start_input.disabled = false
' save_input.disabled = true
' cancel_input.disabled = true
' exit sub
' end if
' if len(rtrim(daystartno.value))> 0 then
' else
' msgbox "请输入日!",,"提示窗口"
' start_input.disabled = false
' save_input.disabled = true
' cancel_input.disabled = true
' exit sub
' end if
if len(rtrim(monthstartno.value))>0 then
if len(rtrim(monthendno.value))> 0 then
else
msgbox "请输入结束月份!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
monthendno.value=monthstartno.value
exit sub
end if
end if
if len(rtrim(daystartno.value))>0 then
if len(rtrim(daysendno.value))> 0 then
else
msgbox "请输入结束日!",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
daysendno.value = daystartno.value
exit sub
end if
end if
if len(rtrim(weekstartno.value)) > 0 then
if len(rtrim(weekendno.value)) > 0 then
if int(rtrim(weekendno.value)) < int(rtrim(weekstartno.value)) then
msgbox "终止周必须不小于起始周!"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
exit sub
end if
else
weekendno.value = weekstartno.value
end if
end if
if len(rtrim(weekstartno.value))=0 then
if isdate(yearno.value+"/"+monthstartno.value+"/"+daystartno.value) then
else
msgbox "对不起!此开始日期格式输入错误,请重新输入",,"提示窗口"
start_input.disabled = false
save_input.disabled = true
cancel_input.disabled = true
EXIT SUB
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -