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

📄 单据查询.frm

📁 财务信息管理系统,适合做毕业论文的人使用
💻 FRM
📖 第 1 页 / 共 3 页
字号:
'*返回值  : True : 成功                                               *
'*********************************************************************
Private Function VerifyFind() As Boolean
    Dim i As Integer, bWhere As Boolean
    
    VerifyFind = False
    sqlWhere = " "
    ' 日期
    If edtDateFrom <> "" Then
        edtDateFrom = ForDate(edtDateFrom)
        If IsDate(edtDateFrom) Then
            bWhere = True
            sqlWhere = " AND [dbill_date] >='" & FormatDate(edtDateFrom) & "' "
        Else
            Beep
            MsgBox "日期非法,请检查!!", vbInformation, zjGl_Name
            SetTxtFocus edtDateFrom
            Exit Function
        End If
    End If
    
    If edtDateTo <> "" Then
        edtDateTo = ForDate(edtDateTo)
        If IsDate(edtDateTo) Then
            sqlWhere = sqlWhere & "AND [dbill_date] <='" & FormatDate(edtDateTo) & "' "
        Else
            Beep
            MsgBox "日期非法,请检查!!", vbInformation, zjGl_Name
            SetTxtFocus edtDateTo
            Exit Function
        End If
    End If
    
    If edtDateFrom <> "" And edtDateTo <> "" Then
      If CDate(edtDateFrom) > CDate(edtDateTo) Then
        Beep
        MsgBox "日期范围错误,请检查!", vbInformation, zjGl_Name
        SetTxtFocus edtDateTo
        Exit Function
      End If
    End If
    
    '业务编号
    If edtBhFrom <> "" Then
        edtBhFrom = right("000000000" & edtBhFrom, 10)
        sqlWhere = sqlWhere & "AND " & cYwID & ">='" & cClassID & String(8 - Len(edtBhFrom), "0") & edtBhFrom & "' "
    End If
    
    If edtBhTo <> "" Then
        edtBhTo = right("000000000" & edtBhTo, 10)
        sqlWhere = sqlWhere & "AND " & cYwID & "<='" & cClassID & String(8 - Len(edtBhTo), "0") & edtBhTo & "' "
    End If
    
    If edtBhFrom <> "" And edtBhTo <> "" Then
      If edtBhFrom > edtBhTo Then
         Beep
         MsgBox "业务编号范围错误,请检查!", vbInformation, zjGl_Name
         SetTxtFocus edtBhTo
         Exit Function
      End If
    End If
    
    '银行名称
    If edtDwmc <> "" Then
       sqlWhere = sqlWhere & "AND [cAccID] IN (SELECT [cAccID] FROM FD_AccDef INNER JOIN " & _
                     "FD_AccUnit ON FD_AccDef.cUnitCode=FD_AccUnit.cUnitCode WHERE " & _
                     "FD_AccUnit.cUnitName LIKE '" & edtDwmc & "') "
    End If
    
    '银行账户
    If edtZhh <> "" Then
        sqlWhere = sqlWhere & "AND [cAccID] LIKE '" & edtZhh & "' "
    End If
    
    '金额
    If edtJeFrom <> "" Then
        sqlWhere = sqlWhere & "AND [mmoney] >=" & CCur(edtJeFrom) & " "
    End If
   
    If edtJeTo <> "" Then
        sqlWhere = sqlWhere & "AND [mmoney] <=" & CCur(edtJeTo) & " "
    End If
    
    If edtJeFrom <> "" And edtJeTo <> "" Then
      If CDbl(edtJeFrom) > CDbl(edtJeTo) Then
         Beep
         MsgBox "金额范围错误,请检查!", vbInformation, zjGl_Name
         SetTxtFocus edtJeTo
         Exit Function
      End If
    End If
    
    '本位币金额
    If edtBjeFrom <> "" Then
        sqlWhere = sqlWhere & "AND [mmoney_f] >=" & CCur(edtBjeFrom) & " "
    End If
   
    If edtBjeTo <> "" Then
        sqlWhere = sqlWhere & "AND [mmoney_f] <=" & CCur(edtBjeTo) & " "
    End If
    
    If edtBjeFrom <> "" And edtBjeTo <> "" Then
      If CDbl(edtBjeFrom) > CDbl(edtBjeTo) Then
         Beep
         MsgBox "金额范围错误,请检查!", vbInformation, zjGl_Name
         SetTxtFocus edtBjeTo
         Exit Function
      End If
    End If
    
    '制单人
    If edtZDR <> "" Then
        sqlWhere = sqlWhere & "AND [cBillCode] LIKE '" & edtZDR & "' "
    End If
    
    '是否记账
    If Check1.Value = 0 Then
        sqlWhere = sqlWhere & "AND [cBookCode] IS NOT NULL "
    End If
    sqlWhere = sqlWhere & "ORDER BY [dbill_date]"
    
    VerifyFind = True
    
End Function

Private Sub edtBhFrom_LostFocus()
   If edtBhFrom <> "" Then
      edtBhFrom = right("000000000" & edtBhFrom, 10)
   End If

End Sub

Private Sub edtBhTo_LostFocus()
   If edtBhTo <> "" Then
      edtBhTo = right("000000000" & edtBhTo, 10)
   End If
End Sub

Private Sub edtDateFrom_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      Command1(0).Value = True
      edtDateFrom.SetFocus
   End If
End Sub

Private Sub edtDateFrom_LostFocus()
   If edtDateFrom <> "" Then
       edtDateFrom = ForDate(edtDateFrom)
       If IsDate(edtDateFrom) Then
           edtDateFrom = FormatDate(edtDateFrom)
       Else
           MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
           SetTxtFocus edtDateFrom
       End If
   End If

End Sub

Private Sub edtDateTo_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      Command1(1).Value = True
      edtDateTo.SetFocus
   End If
End Sub

Private Sub edtDateTo_LostFocus()
   If edtDateTo <> "" Then
       edtDateTo = ForDate(edtDateTo)
       If IsDate(edtDateTo) Then
           edtDateTo = FormatDate(edtDateTo)
       Else
           MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
           SetTxtFocus edtDateTo
       End If
   End If

End Sub

Private Sub edtDwmc_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      RefCmd1(0).RunReference: edtDwmc.SetFocus
   End If
End Sub

Private Sub edtZhh_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyF2 Then
      RefCmd1(1).RunReference: edtZhh.SetFocus
   End If
End Sub

Private Sub Form_Load()
    Me.Icon = LoadResPicture(109, vbResIcon)
   InitFindForm
   Command2(0).Picture = LoadResPicture(103, vbResBitmap)
   Command2(1).Picture = LoadResPicture(104, vbResBitmap)
   Command1(0).Picture = LoadResPicture(1108, vbResBitmap)
   Command1(1).Picture = LoadResPicture(1108, vbResBitmap)
   CenterForm Me
End Sub

Private Sub InitFindForm()
    Dim id As Integer
    
    Select Case iFindtype
        Case 0
            Me.Caption = "银行贷款查询"
            Label1(2) = "银行名称"
            Label1(3) = "银行账号"
            cYwID = "cCreID"
            cClassID = "05"
            Me.HelpContextID = 88000027
        Case 1
            Me.Caption = "内部贷款查询"
            Label1(2) = "单位名称"
            Label1(3) = "账 户 号"
            cYwID = "cCreID"
            cClassID = "06"
            Me.HelpContextID = 88000029
        Case 2
            Me.Caption = "银行还款查询"
            Label1(2) = "银行名称"
            Label1(3) = "银行账号"
            cYwID = "cRetID"
            cClassID = "08"
            Me.HelpContextID = 88000033
        Case 3
            Me.Caption = "内部还款查询"
            Label1(2) = "单位名称"
            Label1(3) = "账 户 号"
            cYwID = "cRetID"
            cClassID = "09"
            Me.HelpContextID = 88000037
        Case 4
            Me.Caption = "银行还息查询"
            Label1(2) = "银行名称"
            Label1(3) = "银行账号"
            cYwID = "cCraID"
            cClassID = "10"
            Me.HelpContextID = 88000035
        Case 5
            Me.Caption = "内部还息查询"
            Label1(2) = "单位名称"
            Label1(3) = "账 户 号"
            cYwID = "cCraID"
            cClassID = "11"
            Me.HelpContextID = 88000039
    End Select
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If Quitfs Then
        Select Case iFindtype
            Case 0
                zjLogInfo.TaskExec "FD020502", 0, zjLogInfo.cIYear
                'zjGen_arr.FD020502 = False
            Case 1
                zjLogInfo.TaskExec "FD020802", 0, zjLogInfo.cIYear
                'zjGen_arr.FD020802 = False
            Case 2
                zjLogInfo.TaskExec "FD020602", 0, zjLogInfo.cIYear
                'zjGen_arr.FD020602 = False
            Case 3
                zjLogInfo.TaskExec "FD020902", 0, zjLogInfo.cIYear
                'zjGen_arr.FD020902 = False
            Case 4
                zjLogInfo.TaskExec "FD020702", 0, zjLogInfo.cIYear
                'zjGen_arr.FD020702 = False
            Case 5
                zjLogInfo.TaskExec "FD021002", 0, zjLogInfo.cIYear
                'zjGen_arr.FD021002 = False
        End Select
        zjLogInfo.ClearError
    End If
End Sub

Private Sub RefCmd1_Initialize(Index As Integer)
   Select Case Index
      Case 0:
         RefCmd1(Index).InitSys 0, dbsZJ
         RefCmd1(Index).InitSys 1, edtDwmc
      Case 1:
         RefCmd1(Index).InitSys 0, dbsZJ
         RefCmd1(Index).InitSys 1, edtZhh
         RefCmd1(Index).InitSys 2, edtDwmc
   End Select
   
End Sub

Private Sub RefCmd1_RefCancel(Index As Integer)
   Select Case Index
      Case 0: edtDwmc.SetFocus
      Case 1: edtZhh.SetFocus
   End Select
   
End Sub

Private Sub RefCmd1_RefOK(Index As Integer, Code As String)
   Select Case Index
      Case 0: edtDwmc = Code: edtDwmc.SetFocus
      Case 1: edtZhh = Code: edtZhh.SetFocus
   End Select
   
End Sub

⌨️ 快捷键说明

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