?? +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 + -