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

📄 frmmain.frm

📁 用VB实现连接oracle817数据月报数输入并统计
💻 FRM
📖 第 1 页 / 共 4 页
字号:
    Text1(6).Text = gYbmx(nZdxh).QCGZF
    Text1(7).Text = gYbmx(nZdxh).QT
    Text1(8).Text = gYbmx(nZdxh).GGFYFT
    Text1(9).Text = gYbmx(nZdxh).ZJBC
    Text1(10).Text = gYbmx(nZdxh).BCFT
    Text1(11).Text = gYbmx(nZdxh).SGJFXB
    Text1(12).Text = gYbmx(nZdxh).ZFK
    Text1(13).Text = gYbmx(nZdxh).ZDFYXJ
    Command1(0).Enabled = True
    Command1(1).Enabled = False
    Command1(2).Enabled = True
    nBcbz = 1
Else
    Command1(1).Enabled = False
    Command1(2).Enabled = False

End If

End Sub

Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)

Select Case Index
       Case 0
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
            If Len(Trim(Text1(0).Text)) < 1 Then
               gYbmx(nZdxh).BGSBGZF = 0
            Else
               gYbmx(nZdxh).BGSBGZF = gNumVal(Text1(0).Text)
            End If
   
            End If
            
       Case 1
            
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(1).Text)) < 1 Then
                  gYbmx(nZdxh).ZYSBGZF = 0
               Else
                  gYbmx(nZdxh).ZYSBGZF = gNumVal(Text1(1).Text)
               End If
        
            End If
       Case 2
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(2).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(2).Text)
               End If
            End If
       
       Case 3
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(3).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(3).Text)
               End If
            
            End If
          
       Case 4
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(4).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(4).Text)
               End If
            
            End If
       
       Case 5
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(5).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(5).Text)
               End If
            
            End If
       
       Case 6
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(6).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(6).Text)
               End If
            
            End If
       
       Case 7
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(7).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(7).Text)
               End If
            
            End If
       Case 8
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(8).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(8).Text)
               End If
            
            End If
        
      Case 9
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(9).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(9).Text)
               End If
            
            End If
     Case 10
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(10).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(10).Text)
               End If
            
            End If
     Case 11
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Text1(Index + 1).SetFocus
                  End If
               Else
                 Text1(Index).Text = "0"
                 Text1(Index + 1).SetFocus
               End If
               If Len(Trim(Text1(11).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(11).Text)
               End If
            
            End If
      Case 12
            
            If KeyCode = vbKeyReturn Then
               If Len(Trim(Text1(Index).Text) >= 1) Then
               
                  If gNumVal(Text1(Index).Text) < 0 Then
                     SM "输入数据有误!"
                     Text1(Index).SetFocus
                     Exit Sub
                  Else
                     Command1(0).SetFocus
                  End If
               Else
                  Text1(Index).Text = "0"
                  Command1(0).SetFocus
               End If
               If Len(Trim(Text1(12).Text)) < 1 Then
                  gYbmx(nZdxh).JTGJGZF = 0
               Else
                  gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(12).Text)
               End If
            
            End If
            
End Select
End Sub

Private Sub Timer1_Timer()
StatusBar1.Panels(2).Text = "时间:" & Time
End Sub


Private Sub Text1_LostFocus(Index As Integer)
Dim i As Long
Dim tmpFy As Double
Dim Sum As Double

Select Case Index
       Case 0, 1, 2, 3, 4, 5, 6, 7, 8
            
            Sum = 0
            For i = 0 To 8
                If Len(Trim(Text1(i).Text)) >= 1 Then
                   tmpFy = gNumVal(Text1(i).Text)
                   Sum = Sum + tmpFy
                End If
                
            Next i
            Text1(13).Text = Sum
End Select

End Sub

⌨️ 快捷键说明

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