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

📄 frmbanci.frm

📁 用microsoft vb6.0写的上班考勤系统!
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      Else
        RstBan.Fields(12) = 0
      End If
      
      
      If Xiang5.Value = True Or Xia5.Value = True And Frame7.Visible = True Then
        'Wu.Value = Format(Time, "hh:mm:ss")
        RstBan.Fields(13) = Format(Wu.Value, "hh:mm:ss")
        RstBan.Fields(26) = Format(Wu1.Value, "hh:mm:ss")
        RstBan.Fields(27) = Format(Wu2.Value, "hh:mm:ss")
        
        If Xiang5.Value = True Then
          RstBan.Fields(14) = 1
        End If
        If Xia5.Value = True Then
          RstBan.Fields(14) = 2
        End If
      Else
        RstBan.Fields(14) = 0
      End If
      
      
      If Xiang6.Value = True Or Xia6.Value = True And Frame8.Visible = True Then
        'Liu.Value = Format(Time, "hh:mm:ss")
        RstBan.Fields(15) = Format(Liu.Value, "hh:mm:ss")
        RstBan.Fields(28) = Format(Liu1.Value, "hh:mm:ss")
        RstBan.Fields(29) = Format(Liu2.Value, "hh:mm:ss")
        If Xiang6.Value = True Then
          RstBan.Fields(16) = 1
        End If
        If Xia6.Value = True Then
          RstBan.Fields(16) = 2
        End If
      Else
        RstBan.Fields(16) = 0
      End If
      RstBan.Fields(17) = MingZi
    RstBan.UpdateBatch
    MsgBox "数据已保存!!", vbOKOnly, "提醒!!"
  'End If
  
End Sub

Private Sub bumen_Change()
  'If Bumen.Text = "1" Then
  '   Bumen.Text = "筹建处"
  'End If
  
  'If Bumen.Text = "2" Then
  '   Bumen.Text = "管理处"
  'End If
  
  'If Bumen.Text = "3" Then
  '   Bumen.Text = "会所"
  'End If
  If Not IsNumeric(bumen) Then Exit Sub
  'If Dd = 1 Then Exit Sub
  Set RstShuju = New ADODB.Recordset
  RstShuju.Open "select * from bumen where bumenno='" + bumen.Text + "' ", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
  If Not RstShuju.EOF Then
    'Dd = 1
    bumen.Text = RstShuju.Fields(0)
    
  End If
End Sub

Private Sub bumen_GotFocus()
'StatusBar1.Panels(1).Text = "1、筹建处 2、管理处 3、会所"
Dim AA, BM, BMO
Dim i As Integer
Set RstShuju = New ADODB.Recordset
RstShuju.Open "select * from bumen order by bumenno", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
Do While Not RstShuju.EOF
   BM = RstShuju.Fields(0)
   BMO = RstShuju.Fields(1)
  AA = AA & Space(2) & BMO & "、" & BM
  RstShuju.MoveNext
Loop
StatusBar1.Panels(1).Text = AA
End Sub

Private Sub Bumen_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then
     jiwei.SetFocus
End If
   
'If KeyCode = 38 Then
'   diangua.SetFocus
'End If
End Sub

Private Sub bumen_LostFocus()
StatusBar1.Panels(1).Text = ""
End Sub

Private Sub Command1_Click()
'CnnBan.Execute "DELETE  FROM ban " _
                   & "WHERE " _
                   & "(bumen= ' " & Trim(Bumen.Text) & " ') AND " _
                   & "(jiwei='" & Trim(SelJiwei.Text) & "')  " _
                   & ""
CnnBan.Execute "DELETE FROM ban   " _
                 & "WHERE " _
                 & "bumen='" + bumen.Text + "' and " _
                 & "jiwei='" + SelJiwei.Text + "' " _
                 & " "
End Sub

Private Sub Form_Load()
  Set CnnBan = New ADODB.Connection
  CnnBan.Open "kaoqin", "andy", "1234"
  Set RstBan = New ADODB.Recordset
  RstBan.Open "select * from Ban", CnnBan, adOpenStatic, adLockOptimistic, adCmdText
  'StatusBar1.Panels(3).Text = MingZi
  Addinfo = False
  ModiInfo = False
  
  Yi.Enabled = False
  Er.Enabled = False
  San.Enabled = False
  Si.Enabled = False
  Wu.Enabled = False
  Liu.Enabled = False

End Sub

Private Sub Jiwei_Change()
If Not IsNumeric(jiwei) Then Exit Sub
  'If Dd = 1 Then Exit Sub
  Set RstShuju = New ADODB.Recordset
  RstShuju.Open "select * from jiwei where bumen='" + bumen.Text + "' and jiweino='" + jiwei.Text + "'", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
  If Not RstShuju.EOF Then
    'Dd = 1
    jiwei.Text = RstShuju.Fields(0)
    
  End If
End Sub

Private Sub Jiwei_GotFocus()
Dim AA, JW, JWO
Dim e As Integer

Set RstShuju = New ADODB.Recordset
RstShuju.Open "select * from jiwei where bumen='" & bumen.Text & "' order by jiweino", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
Do While Not RstShuju.EOF
   JW = RstShuju.Fields(0)
   JWO = RstShuju.Fields(2)
  BB = BB & Space(2) & JWO & "、" & JW
  RstShuju.MoveNext
Loop
StatusBar1.Panels(1).Text = BB
End Sub

Private Sub Jiwei_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then
     Banhao.SetFocus
   End If
   
If KeyCode = 38 Then
    bumen.SetFocus
End If
End Sub

Private Sub Jiwei_LostFocus()
StatusBar1.Panels(1).Text = ""
End Sub

Private Sub Kashu_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then
    BanMing.SetFocus
End If
End Sub

Private Sub Kashu_LostFocus()
  If Kashu.Text = "" Then Exit Sub
  If Kashu.Text = 1 Then
     Frame3.Visible = True
     Frame4.Visible = False
     Frame5.Visible = False
     Frame6.Visible = False
     Frame7.Visible = False
     Frame8.Visible = False

     Yi.Enabled = True
     Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = False
     Er1.Enabled = False
     Er2.Enabled = False
     San.Enabled = False
     San1.Enabled = False
     San2.Enabled = False
     Si.Enabled = False
     Si1.Enabled = False
     Si2.Enabled = False
     Wu.Enabled = False
     Wu1.Enabled = False
     Wu2.Enabled = False
     Liu.Enabled = False
     Liu1.Enabled = False
     Liu2.Enabled = False
  End If
  
  If Kashu.Text = 2 Then
     Frame3.Visible = True
     Frame4.Visible = True
     Frame5.Visible = False
     Frame6.Visible = False
     Frame7.Visible = False
     Frame8.Visible = False
     Yi.Enabled = True
     Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = True
     Er1.Enabled = True
     Er2.Enabled = True
     San.Enabled = False
     San1.Enabled = False
     San2.Enabled = False
     Si.Enabled = False
     Si1.Enabled = False
     Si2.Enabled = False
     Wu.Enabled = False
     Wu1.Enabled = False
     Wu2.Enabled = False
     Liu.Enabled = False
     Liu1.Enabled = False
     Liu2.Enabled = False
  End If
  
  If Kashu.Text = 3 Then
     Frame3.Visible = True
     Frame4.Visible = True
     Frame5.Visible = True
     Frame6.Visible = False
     Frame7.Visible = False
     Frame8.Visible = False
     Yi.Enabled = True
     Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = True
     Er1.Enabled = True
     Er2.Enabled = True
     San.Enabled = True
     Si1.Enabled = False
     Si2.Enabled = False
     Wu.Enabled = False
     Wu1.Enabled = False
     Wu2.Enabled = False
     Liu.Enabled = False
     Liu1.Enabled = False
     Liu2.Enabled = False
  
  End If
  
  If Kashu.Text = 4 Then
    Frame3.Visible = True
    Frame4.Visible = True
    Frame5.Visible = True
    Frame6.Visible = True
    Frame8.Visible = False
    Frame7.Visible = False
    Yi.Enabled = True
     Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = True
     Er1.Enabled = True
     Er2.Enabled = True
     San.Enabled = True
     San1.Enabled = True
     San2.Enabled = True
    Si.Enabled = True
    Si1.Enabled = True
    Si2.Enabled = True
    Wu.Enabled = False
    Wu1.Enabled = False
    Wu2.Enabled = False
    Liu.Enabled = False
    Liu1.Enabled = False
    Liu2.Enabled = False
 
  End If
  
  If Kashu.Text = 5 Then
    Frame3.Visible = True
    Frame4.Visible = True
    Frame5.Visible = True
    Frame6.Visible = True
    Frame7.Visible = True
    Frame8.Visible = False
    Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = True
     Er1.Enabled = True
     Er2.Enabled = True
     San.Enabled = True
     San1.Enabled = True
     San2.Enabled = True
    Si.Enabled = True
    Si1.Enabled = True
    Si2.Enabled = True
    Wu.Enabled = True
    Wu1.Enabled = True
    Wu2.Enabled = True
    Liu.Enabled = False
    Liu1.Enabled = False
    Liu2.Enabled = False
  End If
  
  If Kashu.Text = 6 Then
    Frame3.Visible = True
    Frame4.Visible = True
    Frame5.Visible = True
    Frame6.Visible = True
    Frame7.Visible = True
    Frame8.Visible = True
    Yi.Enabled = True
    Yi1.Enabled = True
     Yi2.Enabled = True
     Er.Enabled = True
     Er1.Enabled = True
     Er2.Enabled = True
     San.Enabled = True
     San1.Enabled = True
     San2.Enabled = True
    Si.Enabled = True
    Si1.Enabled = True
    Si2.Enabled = True
    Wu.Enabled = True
    Wu1.Enabled = True
    Wu2.Enabled = True
    Liu.Enabled = True
    Liu1.Enabled = True
    Liu2.Enabled = True
  End If
  
End Sub


Private Sub SelJiwei_Change()
'If ModiInfo = True Then
'  RstBan.Open "select * from ban where bumen='" + Bumen.Text + "' and  jiwei='" + Jiwei.Text + "'", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
'End If
'  Banhao.Text = RstBan.Fields(2)
'  Banming.Text = RstBan.Fields(3)
'  Kashu.Text = RstBan.Fields(4)
End Sub

Private Sub SelJiwei_Click()
RstBan.Close
If ModiInfo = True Then
 RstBan.Open "select * from ban where bumen='" + bumen.Text + "'and  jiwei='" + SelJiwei.Text + "' ", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
End If
  Banhao.Text = RstBan.Fields(2)
  BanMing.Text = RstBan.Fields(3)
  Kashu.Text = RstBan.Fields(4)
End Sub

Private Sub SelJiwei_GotFocus()
RstBan.Close
If ModiInfo = True Then
  RstBan.Open "select * from ban where bumen='" + bumen.Text + "'", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText

  Do While Not RstBan.EOF
      SelJiwei.AddItem RstBan!jiwei
      RstBan.MoveNext
  Loop
  
  
  
End If
End Sub

Private Sub SelJiwei_LostFocus()
If ModiInfo = True Then
  Set RstBan = New ADODB.Recordset
  RstBan.Open "select * from ban where bumen='" + bumen.Text + "' and  jiwei='" + SelJiwei.Text + "'", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
End If
If SelJiwei.Text <> "" Then
  Banhao.Text = RstBan.Fields(2)
  BanMing.Text = RstBan.Fields(3)
  Kashu.Text = RstBan.Fields(4)
End If
End Sub

⌨️ 快捷键说明

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