⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 +i

📁 学生日常管理系统
💻
📖 第 1 页 / 共 5 页
字号:
	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      
 
     datestart=rtrim(yearno.value +"/"+monthstartno.value+"/"+daystartno.value)

     dateend=rtrim(endyearno.value +"/"+monthendno.value+"/"+daysendno.value)
   
 
 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
  
  
  
  
 ' if  len(trim(classno.value))<>0 then
    
     
      'rds1.SQL="select 班号,请假=SUM(请假),旷课=SUM(旷课),迟到=SUM(迟到),早退=SUM(早退) from dailymanage  where  班号='"&classno.value&"'  and convert(int,第几周)>="&int(weekstartno.value)&" and convert(int,第几周)<="&int(weekendno.value)&""&_ 
      '"and convert(datetime,日期)>=convert(datetime,'"&datestart&"') and convert(datetime,日期)<=convert(datetime,'"&dateend&"')  GROUP BY 班号 " 
      'rds1.ExecuteOptions = 1
   
      ' rds1.Refresh 
    if  len(rtrim(weekstartno.value))>0 then  
       
         rds1.SQL="select 班号,请假=SUM(请假),旷课=SUM(旷课),迟到=SUM(迟到),早退=SUM(早退) from dailymanage  where   convert(int,第几周)>="&int(weekstartno.value)&" and convert(int,第几周)<="&int(weekendno.value)&""&_ 
        " and 学期='"&termno.value&"'  GROUP BY 班号 "   '班号='"&classno.value&"'  and
         rds1.ExecuteOptions = 1
   
         rds1.Refresh  
       
       
         if rds1.Recordset.recordcount<=0 then
    
            msgbox "没有找到满足此条件的数据!",,"提示窗口"
            exit sub
         else
           class_print.disabled = false
         
         end if
  
    else
          rds1.SQL="select 班号,请假=SUM(请假),旷课=SUM(旷课),迟到=SUM(迟到),早退=SUM(早退) from dailymanage  where   学期='"&termno.value&"' "&_ 
        "and convert(datetime,日期)>=convert(datetime,'"&datestart&"') and convert(datetime,日期)<=convert(datetime,'"&dateend&"')  GROUP BY 班号 "  '班号='"&classno.value&"'  and
        rds1.ExecuteOptions = 1
       
         rds1.Refresh  
       
       
         if rds1.Recordset.recordcount<=0 then
    
            msgbox "没有找到满足此条件的数据!",,"提示窗口"
            exit sub
         else
            
            class_print.disabled = false
         
         end if
    
    end if
  
  
 ' else 
  
 '      msgbox "请先输入班号!",,"提示窗口"
  
'  end if
 
 

end sub

' print student 
'==================================================================
'按学号进行打印
sub printno()

   if rds1.Recordset.recordcount<=0 then
     exit  sub
     
   end if  
   
   student_print.disabled = true
            
    Set xlApp = CreateObject("Excel.Application") 
 
    xlApp.Visible = True 
 
    Set xlBook = xlApp.Workbooks.Add
    
    Set xlSheet = xlBook.Worksheets(1)
 
   'j=0
  
   
   rds1.Recordset.movefirst
   
   while not rds1.Recordset.eof
   
    'for k=j+1 to j+21
    for y=0 to 5
     
     select case y
      case 0
        k=1
      case 1
        k=24
      case 2
        k=48
      case 3
        k=72
      case 4
        k=96
      case 5
        k=120
     end select
     
     if len(rtrim(weekstartno.value))>0 then
     
        xlSheet.Cells(k, 10) = yearno.value+"-"+endyearno.value+"学年度"+termno.value+"第"+weekstartno.value+"、"+weekendno.value+"周" 
        xlSheet.Cells(k+1,10) ="海南省琼海师范学校学生考勤情况统计表"
     
     else
     
          xlSheet.Cells(k, 10) = yearno.value+"-"+endyearno.value+"学年度"+termno.value+"("+yearno.value+"年"+monthstartno.value+"月"+daystartno.value+"日"+"--"+monthendno.value+"月"+daysendno.value+"日)"  
        xlSheet.Cells(k+1,10) ="海南省琼海师范学校学生考勤情况统计表"
     
     end if  
      
        for i=0 to 3
        
        '当I=0时及第一次印时,则行已固定
          if i=0 then
            ' msgbox rds1.Recordset.fields(0).name                               
            xlsheet.cells(k+2,2)=rds1.Recordset.fields(0).name
            xlsheet.cells(k+2,3)=rds1.Recordset.fields(2).name
            xlsheet.cells(k+2,4)=rds1.Recordset.fields(3).name+"(节)"                        
            xlsheet.cells(k+2,5)=rds1.Recordset.fields(4).name+"(节)"
            xlsheet.cells(k+2,6)=rds1.Recordset.fields(5).name+"(次)"
            xlsheet.cells(k+2,7)=rds1.Recordset.fields(6).name+"(次)"
            
          end if   
         '////////// 
         if i=1 then
            ' msgbox k+2                           
            xlsheet.cells(k+2,8)=rds1.Recordset.fields(0).name
            xlsheet.cells(k+2,9)=rds1.Recordset.fields(2).name
            xlsheet.cells(k+2,10)=rds1.Recordset.fields(3).name+"(节)"                        
            xlsheet.cells(k+2,11)=rds1.Recordset.fields(4).name+"(节)"
            xlsheet.cells(k+2,12)=rds1.Recordset.fields(5).name+"(次)"
            xlsheet.cells(k+2,13)=rds1.Recordset.fields(6).name+"(次)"
            
          end if
         '///////////////////////
         if i=2 then
                                         
            xlsheet.cells(k+2,14)=rds1.Recordset.fields(0).name
            xlsheet.cells(k+2,15)=rds1.Recordset.fields(2).name
            xlsheet.cells(k+2,16)=rds1.Recordset.fields(3).name+"(节)"                        
            xlsheet.cells(k+2,17)=rds1.Recordset.fields(4).name+"(节)"
            xlsheet.cells(k+2,18)=rds1.Recordset.fields(5).name+"(次)"
            xlsheet.cells(k+2,19)=rds1.Recordset.fields(6).name+"(次)"
            
          end if   
         '//////////////////////
         
         if i=3 then
                                            
            xlsheet.cells(k+2,20)=rds1.Recordset.fields(0).name
            xlsheet.cells(k+2,21)=rds1.Recordset.fields(2).name
            xlsheet.cells(k+2,22)=rds1.Recordset.fields(3).name+"(节)"                        
            xlsheet.cells(k+2,23)=rds1.Recordset.fields(4).name+"(节)"
            xlsheet.cells(k+2,24)=rds1.Recordset.fields(5).name+"(次)"
            xlsheet.cells(k+2,25)=rds1.Recordset.fields(6).name+"(次)"
            
         end if   
         '//////////////
           
                            
      for j=0 to 19
          
         
         
         
       if rds1.Recordset.eof=true then
       
          exit sub
          
       end if  
          
       if i=0 then
             
           If isnull(rds1.Recordset.fields(0))=false  then  ' isnull(rds1.Recordset.fields(0))=false
              
              if rds1.Recordset.fields(0)=oldclass then
                
              else
                                   
               if IsNumeric(rds1.Recordset.fields(0)) = true  Then
    
        
                   xlSheet.Cells(k+3,2) = trim(cstr(rds1.Recordset.fields(0)))
                   
                                
               else        

                   xlSheet.Cells(k+3,2) = trim(cstr(rds1.Recordset.fields(0)))
                                     

               End If
           end if
           
    
          end if   
             
         '====================
         If isnull(rds1.Recordset.fields(2))=false  then   
                                         
               if IsNumeric(rds1.Recordset.fields(2)) = true  Then
                   xlSheet.Cells(k+3,3) = trim(cstr(rds1.Recordset.fields(2)))
                
               else        
                   xlSheet.Cells(k+3,3) = trim(cstr(rds1.Recordset.fields(2)))
             End If
    
          end if   
        '=============================          
         
         If rds1.Recordset.fields(3)<>0  then   ' isnull(rds1.Recordset.fields(3))=false
    
               if IsNumeric(rds1.Recordset.fields(3)) = true  Then
    
                          
                   xlSheet.Cells(k+3,4) = trim(cstr(rds1.Recordset.fields(3)))
               
               else        

                   xlSheet.Cells(k+3,4) = trim(cstr(rds1.Recordset.fields(3)))
        
             End If
    
         end if   
           
     '=================================
           If rds1.Recordset.fields(4)<>0  then   
    
             '   msgbox isnull(rds1.Recordset.fields(4))        
      
               if IsNumeric(rds1.Recordset.fields(4)) = true  Then
    
                          
                   xlSheet.Cells(k+3,5) = trim(cstr(rds1.Recordset.fields(4)))
               
               else        

                   xlSheet.Cells(k+3,5) = trim(cstr(rds1.Recordset.fields(4)))
        
               End If
     
          end if   
  
     
            
         
         '=============================
            If rds1.Recordset.fields(5)<>0  then 
              
              '   msgbox isnull(rds1.Recordset.fields(5))     
      
               if IsNumeric(rds1.Recordset.fields(5)) = true  Then
    
                          
                   xlSheet.Cells(k+3,6) = trim(cstr(rds1.Recordset.fields(5)))
               
                else        

                   xlSheet.Cells(k+3,6) = trim(cstr(rds1.Recordset.fields(5)))
        
                End If
    
            end if   
   
         '============================================
          If rds1.Recordset.fields(6)<>0  then   
             
           '   msgbox isnull(rds1.Recordset.fields(6))
      
              if IsNumeric(rds1.Recordset.fields(6)) = true  Then
    
                          
                   xlSheet.Cells(k+3,7) = trim(cstr(rds1.Recordset.fields(6)))
               
               else        

                   xlSheet.Cells(k+3,7) = trim(cstr(rds1.Recordset.fields(6)))
        
             End If
    
         end if   
  
     
     end if
     
     '==============================
      if i=1 then
             
           If isnull(rds1.Recordset.fields(0))=false  then
              if rds1.Recordset.fields(0)=oldclass then
                
              else       
                    
               if IsNumeric(rds1.Recordset.fields(0)) = true  Then
        
                   xlSheet.Cells(k+3,8) = trim(cstr(rds1.Recordset.fields(0)))
                                
               else        

                   xlSheet.Cells(k+3,8) = trim(cstr(rds1.Recordset.fields(0)))
    
               End If
 
             end if
    
          end if   
             
         '====================
         If isnull(rds1.Recordset.fields(2))=false  then   
                           
               if IsNumeric(rds1.Recordset.fields(2)) = true  Then
                   xlSheet.Cells(k+3,9) = trim(cstr(rds1.Recordset.fields(2)))
                
               else        
                   xlSheet.Cells(k+3,9) = trim(cstr(rds1.Recordset.fields(2)))
             End If
    
          end if   
        '=============================          
         
         If rds1.Recordset.fields(3)<>0  then   
    
               if IsNumeric(rds1.Recordset.fields(3)) = true  Then
    
                          
                   xlSheet.Cells(k+3,10)= trim(cstr(rds1.Recordset.fields(3)))
               
               else        

                   xlSheet.Cells(k+3,10) = trim(cstr(rds1.Recordset.fields(3)))
        
             End If
    
         end if   
           
     '=================================
           If rds1.Recordset.fields(4)<>0  then   
    
             '   msgbox isnull(rds1.Recordset.fields(4))        
      
               if IsNumeric(rds1.Recordset.fields(4)) = true  Then
    
                          
                   xlSheet.Cells(k+3,11) = trim(cstr(rds1.Recordset.fields(4)))
               
               else        

                   xlSheet.Cells(k+3,11) = trim(cstr(rds1.Recordset.fields(4)))
        
               End If
     
          end if   
  
     
            
         
         '=============================
            If rds1.Recordset.fields(5)<>0  then 
              
      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -