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

📄 frmmain.frm

📁 用VB实现连接oracle817数据月报数输入并统计
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            AutoSize        =   1
            Object.Width           =   8308
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private nZdxh As Long

Private Sub Command1_Click(Index As Integer)
Dim i As Long
Dim tmpArr() As Variant
Dim HaveRs As Boolean
Dim tmpSql(30) As String

Select Case Index
       Case 0
                        
             If (nBcbz = 1) Then   '检查过程中按保存按钮
                
                If nXgbz = 1 Then
                
                   frm_Msg.Show vbModal
                   Command1(0).Enabled = True
                   Command1(1).Enabled = True
                   Command1(2).Enabled = False
                End If
                
                If nQue = 0 & nXgbz = 1 Then
                   Exit Sub
             
                Else
                   Label3.Caption = "正在保存数据.......请稍候"
                   
                   
                   If nXgbz = 1 Then
                      '以下汇总表保存
             
                      tmpSql(0) = "Insert into B_YBHZ(VHZXH,NYBND,NYBYF,DDJRQ,VZBRDH) VALUES ('" & _
                                      gYbhz.HZXH & "'," & gYbhz.YBND & "," & gYbhz.YBYF & ",to_date('" & _
                                      gYbhz.DJRQ & "','YYYY-MM-DD'),'" & gYbhz.ZBRDH & "')"

                      '以下明细表保存
             
                      For i = 0 To nZdsl
                          tmpSql(i + 1) = "insert into B_YBMX(VHZXH,VBMDH,NBGSBGZF,NZYSBGZF,NJTGJGZF,NCLGLCBF,NZXKJJSF," & _
                                          "NBZGZF,NQCGZF,NQT,NGGFYFT,NZJBC,NBCFT,NSGJFXB,NZFK) VALUES ('" & _
                                            gYbmx(i).HZXH & "','" & gYbmx(i).BMDH & "'," & _
                                            gYbmx(i).BGSBGZF & "," & gYbmx(i).ZYSBGZF & "," & _
                                            gYbmx(i).JTGJGZF & "," & gYbmx(i).CLGLCBF & "," & _
                                            gYbmx(i).ZXKJJSF & "," & gYbmx(i).BZGZF & "," & _
                                            gYbmx(i).QCGZF & "," & gYbmx(i).QT & "," & _
                                            gYbmx(i).GGFYFT & "," & gYbmx(i).ZJBC & "," & _
                                            gYbmx(i).BCFT & "," & gYbmx(i).SGJFXB & "," & _
                                            gYbmx(i).ZFK & ")"
    
                      Next i
                   
                   Else
                      '以下汇总表修改
             
                      tmpSql(0) = "Update B_YBHZ  set DDJRQ=to_date('" & gYbhz.DJRQ & _
                                  "','YYYY-MM-DD'),VZBRDH='" & gYbhz.ZBRDH & _
                                  "' WHERE VHZXH='" & gYbhz.HZXH & "'"
                      For i = 0 To nZdsl
                          tmpSql(i + 1) = "Update B_YBMX set NBGSBGZF=" & gYbmx(i).BGSBGZF & ",NZYSBGZF=" & gYbmx(i).ZYSBGZF & _
                                          ",NJTGJGZF=" & gYbmx(i).JTGJGZF & ",NCLGLCBF=" & gYbmx(i).CLGLCBF & _
                                          ",NZXKJJSF=" & gYbmx(i).ZXKJJSF & ",NBZGZF=" & gYbmx(i).BZGZF & _
                                          ",NQCGZF=" & gYbmx(i).QCGZF & ",NQT=" & gYbmx(i).QT & _
                                          ",NGGFYFT=" & gYbmx(i).GGFYFT & ",NZJBC=" & gYbmx(i).ZJBC & _
                                          ",NBCFT=" & gYbmx(i).BCFT & ",NSGJFXB=" & gYbmx(i).SGJFXB & ",NZFK=" & gYbmx(i).ZFK & _
                                          " WHERE VHZXH='" & gYbmx(i).HZXH & "' AND VBMDH='" & gYbmx(i).BMDH & "'"
    
                      Next i
                   
                   End If
                   
                   If Not fExecMidSql(tmpSql, nZdsl + 1) Then Exit Sub
                
                      If nXgbz = 1 Then
                      
                         SM "该月数据保存成功!"
                      Else
                         SM "该月数据修改成功!"
                      
                      End If
                      
                      Unload Me
                      frm_lrsj.Text1(0).Text = gYbhz.YBND
                      frm_lrsj.Show vbModal
              
                End If
              
              
              Else  '输入过程中按保存按钮
                                
                  '以下明细表
                  If nZdxh <= nZdsl Then
                     gYbmx(nZdxh).HZXH = gYbhz.HZXH
                     gYbmx(nZdxh).BMDH = gBmdm(nZdxh).BMDH
                     If Len(Trim(Text1(0).Text)) < 1 Then
                        gYbmx(nZdxh).BGSBGZF = 0
                     Else
                        gYbmx(nZdxh).BGSBGZF = gNumVal(Text1(0).Text)
                     End If
                     If Len(Trim(Text1(1).Text)) < 1 Then
                        gYbmx(nZdxh).ZYSBGZF = 0
                     Else
                        gYbmx(nZdxh).ZYSBGZF = gNumVal(Text1(1).Text)
                     End If
                     If Len(Trim(Text1(2).Text)) < 1 Then
                        gYbmx(nZdxh).JTGJGZF = 0
                     Else
                        gYbmx(nZdxh).JTGJGZF = gNumVal(Text1(2).Text)
                     End If
                     
                     If Len(Trim(Text1(3).Text)) < 1 Then
                        gYbmx(nZdxh).CLGLCBF = 0
                     Else
                        gYbmx(nZdxh).CLGLCBF = gNumVal(Text1(3).Text)
                     End If
                     If Len(Trim(Text1(4).Text)) < 1 Then
                        gYbmx(nZdxh).ZXKJJSF = 0
                     Else
                        gYbmx(nZdxh).ZXKJJSF = gNumVal(Text1(4).Text)
                     End If
                     If Len(Trim(Text1(5).Text)) < 1 Then
                        gYbmx(nZdxh).BZGZF = 0
                     Else
                        gYbmx(nZdxh).BZGZF = gNumVal(Text1(5).Text)
                     End If
                     If Len(Trim(Text1(6).Text)) < 1 Then
                        gYbmx(nZdxh).QCGZF = 0
                     Else
                        gYbmx(nZdxh).QCGZF = gNumVal(Text1(6).Text)
                     End If
                     If Len(Trim(Text1(7).Text)) < 1 Then
                        gYbmx(nZdxh).QT = 0
                     Else
                        gYbmx(nZdxh).QT = gNumVal(Text1(7).Text)
                     End If
                     If Len(Trim(Text1(8).Text)) < 1 Then
                        gYbmx(nZdxh).GGFYFT = 0
                     Else
                        gYbmx(nZdxh).GGFYFT = gNumVal(Text1(8).Text)
                     End If
                     If Len(Trim(Text1(13).Text)) < 1 Then
                        gYbmx(nZdxh).ZDFYXJ = 0
                     Else
                        gYbmx(nZdxh).ZDFYXJ = gNumVal(Text1(13).Text)
                     End If
                     If Len(Trim(Text1(9).Text)) < 1 Then
                        gYbmx(nZdxh).ZJBC = 0
                     Else
                        gYbmx(nZdxh).ZJBC = gNumVal(Text1(9).Text)
                     End If
                     If Len(Trim(Text1(10).Text)) < 1 Then
                        gYbmx(nZdxh).BCFT = 0
                     Else
                        gYbmx(nZdxh).BCFT = gNumVal(Text1(10).Text)
                     End If
                     If Len(Trim(Text1(11).Text)) < 1 Then
                        gYbmx(nZdxh).SGJFXB = 0
                     Else
                        gYbmx(nZdxh).SGJFXB = gNumVal(Text1(11).Text)
                     End If
                     If Len(Trim(Text1(12).Text)) < 1 Then
                        gYbmx(nZdxh).ZFK = 0
                     Else
                        gYbmx(nZdxh).ZFK = gNumVal(Text1(12).Text)
                     End If
                     nZdxh = nZdxh + 1
                     
                  End If
                    
                    Command1(1).Enabled = True
                     
                  If nZdxh > nZdsl Then
                     nZdxh = nZdsl
                     frm_Msg.Show vbModal
                     
                     Command1(0).Enabled = True
                     Command1(1).Enabled = True
                     Command1(2).Enabled = False
                     
                     If nQue = 0 Then
                        nBcbz = 1
                        Exit Sub
                     
                     Else
                        Label3.Caption = "正在保存数据.......请稍候"
                         '以下汇总表保存
                     
                        tmpSql(0) = "Insert into B_YBHZ(VHZXH,NYBND,NYBYF,DDJRQ,VZBRDH) VALUES ('" & _
                                              gYbhz.HZXH & "'," & gYbhz.YBND & "," & gYbhz.YBYF & ",to_date('" & _
                                              gYbhz.DJRQ & "','YYYY-MM-DD'),'" & gYbhz.ZBRDH & "')"
        
                         '以下明细表保存
                     
                         For i = 0 To nZdsl
                             tmpSql(i + 1) = "insert into B_YBMX(VHZXH,VBMDH,NBGSBGZF,NZYSBGZF,NJTGJGZF,NCLGLCBF,NZXKJJSF," & _
                                                  "NBZGZF,NQCGZF,NQT,NGGFYFT,NZJBC,NBCFT,NSGJFXB,NZFK) VALUES ('" & _
                                                    gYbmx(i).HZXH & "','" & gYbmx(i).BMDH & "'," & _
                                                    gYbmx(i).BGSBGZF & "," & gYbmx(i).ZYSBGZF & "," & _
                                                    gYbmx(i).JTGJGZF & "," & gYbmx(i).CLGLCBF & "," & _
                                                    gYbmx(i).ZXKJJSF & "," & gYbmx(i).BZGZF & "," & _
                                                    gYbmx(i).QCGZF & "," & gYbmx(i).QT & "," & _
                                                    gYbmx(i).GGFYFT & "," & gYbmx(i).ZJBC & "," & _
                                                    gYbmx(i).BCFT & "," & gYbmx(i).SGJFXB & "," & _
                                                    gYbmx(i).ZFK & ")"
            
                         Next i
                         If Not fExecMidSql(tmpSql, nZdsl + 1) Then Exit Sub
                        
                         SM "该月数据保存成功!"
                         Unload Me
                         frm_lrsj.Text1(0).Text = gYbhz.YBND
                         frm_lrsj.Show vbModal
                      
                      End If
                  
                  Else
                  
                     Label3.Caption = "当前登记单位:" & gBmdm(nZdxh).BMMC
                     For i = 0 To 13
                                           
                         Text1(i).Text = ""
                     Next i
                     
                  End If
                  
                  If nZdxh >= 1 Then
                     Command1(1).Enabled = True
                  Else
                     Command1(1).Enabled = False
                  End If
                  Text1(0).SetFocus
             End If
              
       Case 1
          If nZdxh > 0 Then
             nZdxh = nZdxh - 1
             Label3.Caption = "当前登记单位:" & gBmdm(nZdxh).BMMC
             Text1(0).Text = gYbmx(nZdxh).BGSBGZF
             Text1(1).Text = gYbmx(nZdxh).ZYSBGZF
             Text1(2).Text = gYbmx(nZdxh).JTGJGZF
             Text1(3).Text = gYbmx(nZdxh).CLGLCBF
             Text1(4).Text = gYbmx(nZdxh).ZXKJJSF
             Text1(5).Text = gYbmx(nZdxh).BZGZF
             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(2).Enabled = True
              
          End If
          
          If nZdxh >= 1 Then
            
             Command1(1).Enabled = True
          Else
             Command1(1).Enabled = False
          
          End If
          
       Case 2
          
          If nZdxh < nZdsl Then
             nZdxh = nZdxh + 1
             Label3.Caption = "当前登记单位:" & gBmdm(nZdxh).BMMC
             gYbmx(nZdxh).HZXH = gYbhz.HZXH
             gYbmx(nZdxh).BMDH = gBmdm(nZdxh).BMDH
             Text1(0).Text = gYbmx(nZdxh).BGSBGZF
             Text1(1).Text = gYbmx(nZdxh).ZYSBGZF
             Text1(2).Text = gYbmx(nZdxh).JTGJGZF
             Text1(3).Text = gYbmx(nZdxh).CLGLCBF
             Text1(4).Text = gYbmx(nZdxh).ZXKJJSF
             Text1(5).Text = gYbmx(nZdxh).BZGZF
             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
                 
          End If
          Command1(1).Enabled = True
          
          If nZdxh = nZdsl Then
             nZdxh = nZdsl
             Command1(2).Enabled = False
          End If
          
          Text1(0).SetFocus
          
          
End Select
End Sub

Private Sub Form_Initialize()
If nXgbz <> 0 Then
   If Not GetZdxx Then End
End If

End Sub

Private Sub Form_Load()
Dim i As Integer

nZdxh = 0
Label1.Caption = "全省" & gYbhz.YBND & "年" & gYbhz.YBYF & "月费用登记"
Label3.Caption = "当前登记单位:" & gBmdm(0).BMMC
StatusBar1.Panels(1).Text = "人员:" & gOper.CZYMC
StatusBar1.Panels(2).Text = "时间:" & Time

For i = 0 To nZdsl
    gYbmx(i).ZDFYXJ = gYbmx(i).BGSBGZF + gYbmx(i).ZYSBGZF + gYbmx(i).JTGJGZF + gYbmx(i).CLGLCBF + gYbmx(i).ZXKJJSF + gYbmx(i).BZGZF + gYbmx(i).QCGZF + gYbmx(i).QT + gYbmx(i).GGFYFT
Next i


If nXgbz = 0 Then

    Text1(0).Text = gYbmx(nZdxh).BGSBGZF
    Text1(1).Text = gYbmx(nZdxh).ZYSBGZF
    Text1(2).Text = gYbmx(nZdxh).JTGJGZF
    Text1(3).Text = gYbmx(nZdxh).CLGLCBF
    Text1(4).Text = gYbmx(nZdxh).ZXKJJSF
    Text1(5).Text = gYbmx(nZdxh).BZGZF

⌨️ 快捷键说明

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