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

📄 d

📁 财务分析 财财务分析务分析
💻
字号:
VERSION 5.00
Begin VB.Form pub_SelDate2 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "分析期选择"
   ClientHeight    =   2670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4905
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleWidth      =   4905
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame2 
      Caption         =   "比较期"
      Height          =   960
      Index           =   1
      Left            =   2130
      TabIndex        =   9
      Top             =   1170
      Width           =   2655
      Begin VB.ComboBox Combo_CompDate 
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   300
         Index           =   0
         Left            =   195
         Style           =   2  'Dropdown List
         TabIndex        =   11
         Top             =   225
         Width           =   2295
      End
      Begin VB.ComboBox Combo_CompDate 
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   300
         Index           =   1
         Left            =   195
         Style           =   2  'Dropdown List
         TabIndex        =   10
         Top             =   555
         Width           =   2295
      End
   End
   Begin VB.CommandButton YdCommand 
      Caption         =   "取消(&C)"
      Height          =   300
      Index           =   1
      Left            =   3690
      TabIndex        =   8
      Top             =   2250
      Width           =   1120
   End
   Begin VB.CommandButton YdCommand 
      Caption         =   "确定(&O)"
      Height          =   300
      Index           =   0
      Left            =   2535
      TabIndex        =   7
      Top             =   2250
      Width           =   1120
   End
   Begin VB.Frame Frame2 
      Caption         =   "分析期"
      Height          =   960
      Index           =   0
      Left            =   2130
      TabIndex        =   4
      Top             =   135
      Width           =   2655
      Begin VB.ComboBox Combo_Date 
         Height          =   300
         Index           =   1
         Left            =   180
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   555
         Width           =   2325
      End
      Begin VB.ComboBox Combo_Date 
         Height          =   300
         Index           =   0
         Left            =   180
         Style           =   2  'Dropdown List
         TabIndex        =   5
         Top             =   225
         Width           =   2325
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "类别选择"
      Height          =   2010
      Left            =   105
      TabIndex        =   0
      Top             =   135
      Width           =   1875
      Begin VB.CheckBox chk_ComSel 
         Caption         =   "选择比较期"
         Height          =   270
         Left            =   210
         TabIndex        =   12
         Top             =   1620
         Width           =   1485
      End
      Begin VB.OptionButton DateType 
         Caption         =   "按年"
         Height          =   255
         Index           =   2
         Left            =   195
         TabIndex        =   3
         Top             =   1125
         Width           =   945
      End
      Begin VB.OptionButton DateType 
         Caption         =   "按季"
         Height          =   255
         Index           =   1
         Left            =   195
         TabIndex        =   2
         Top             =   690
         Width           =   945
      End
      Begin VB.OptionButton DateType 
         Caption         =   "按月"
         Height          =   255
         Index           =   0
         Left            =   195
         TabIndex        =   1
         Top             =   255
         Width           =   945
      End
   End
End
Attribute VB_Name = "pub_SelDate2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public iThisYear As Integer '本年
Public iThisMonthBegin As Integer '本年月起始
Public iThisMonthEnd As Integer '本年终止月

Public iCompYear As Integer '比较年
Public iCompMonthBegin As Integer '比较年月开始
Public iCompMonthEnd  As Integer '比较年终止月

Public bSeach As Boolean '是否按下确定键
Public intType As Integer '比较类型,0按月、1按季、2按年
Private Tsxx As String
Private Sub chk_ComSel_Click()
    If chk_ComSel.Value = 1 Then
        If chk_ComSel.Value = 1 Then
            Call FillYear(Combo_CompDate(0))
        End If
    
        Combo_CompDate(0).BackColor = &H80000005
        Combo_CompDate(1).BackColor = &H80000005
        Combo_CompDate(0).Enabled = True
        Combo_CompDate(1).Enabled = True
    Else
        Combo_CompDate(0).BackColor = &H8000000F
        Combo_CompDate(1).BackColor = &H8000000F
        Combo_CompDate(0).Enabled = False
        Combo_CompDate(1).Enabled = False
    End If
    
    Call DateType_Click(intType)
End Sub

Private Sub Combo_CompDate_Click(Index As Integer)
    If Index <> Combo_CompDate.LBound Then Exit Sub
        
    Call FillMonth(Combo_CompDate(1), Combo_CompDate(0).Text)
    
End Sub

Private Sub DateType_Click(Index As Integer)
    Select Case Index
        Case 0 '月
            
            Call FillMonth(Combo_Date(1), Xtyear)
            If chk_ComSel.Value = 1 Then
                Call FillMonth(Combo_CompDate(1), Combo_CompDate(0).Text)
            End If
        Case 1 '季
            
            Call FillThreeMonth(Combo_Date(1), Xtyear)
            If chk_ComSel.Value = 1 Then
                Call FillThreeMonth(Combo_CompDate(1), Combo_CompDate(0).Text)
            End If
        Case 2 '年
            Call FillYear(Combo_Date(1))
            If chk_ComSel.Value = 1 Then
                Call FillYear(Combo_CompDate(1))
            End If
    End Select
    
    
    intType = Index
End Sub

Private Sub Form_Load()
    Me.Icon = XT_Main.Icon
    Me.bSeach = False
    With Combo_Date(0)
        .AddItem Xtyear
        .ListIndex = 0
    End With
End Sub

Private Sub YdCommand_Click(Index As Integer)
    Select Case Index
        Case 0 '确定
            bSeach = True
            Select Case intType
                Case 0 '月
                    iThisYear = Combo_Date(0).Text
                    iThisMonthBegin = Val(Right(Combo_Date(1).Text, 2))
                    iThisMonthEnd = iThisMonthBegin
                    If chk_ComSel.Value = 1 Then
                        iCompYear = Combo_CompDate(0).Text
                        iCompMonthBegin = Val(Right(Combo_CompDate(1).Text, 2))
                        iCompMonthEnd = iCompMonthBegin
'                        If Combo_Date(1).ListIndex > Combo_CompDate(1).ListIndex Then
'                            Tsxx = "日期应从小到大!"
'                            Call Xtxxts(Tsxx, 0, 1)
'                            bSeach = False
'                            Exit Sub
'                        End If
                    End If
                Case 1 '季
                    iThisYear = Combo_Date(0).Text
                    iThisMonthBegin = Val(Mid(Combo_Date(1).Text, 6, 2))
                    iThisMonthEnd = Val(Right(Combo_Date(1).Text, 2))
                    If chk_ComSel.Value = 1 Then
                        iCompYear = Combo_CompDate(0).Text
                        iCompMonthBegin = Val(Mid(Combo_CompDate(1).Text, 6, 2))
                        iCompMonthEnd = Val(Right(Combo_CompDate(1).Text, 2))
'                        If Combo_Date(1).ListIndex > Combo_CompDate(1).ListIndex Then
'                            Tsxx = "日期应从小到大!"
'                            Call Xtxxts(Tsxx, 0, 1)
'                            bSeach = False
'                            Exit Sub
'                        End If
                    End If
                Case 2 '年
                    iThisYear = Combo_Date(0).Text
                    If chk_ComSel.Value = 1 Then
                        iCompYear = Combo_CompDate(0).Text
'                        If Combo_Date(0).ListIndex > Combo_CompDate(0).ListIndex Then
'                            Tsxx = "日期应从小到大!"
'                            Call Xtxxts(Tsxx, 0, 1)
'                            bSeach = False
'                            Exit Sub
'                        End If
                    End If
            End Select
        Case 1 '取消
            bSeach = False
    End Select
    Me.Hide
End Sub
Private Sub FillMonth(PastCombo As ComboBox, ByVal iPastYear As Integer)
    Dim iMonth As Integer
    With PastCombo
        .Clear
        For iMonth = 1 To 12
            .AddItem iPastYear & "." & Format(iMonth, "00")
        Next
        .ListIndex = 0
    End With
End Sub
Private Sub FillThreeMonth(PastCombo As ComboBox, ByVal iPastYear As Integer)
    Dim iThreeMonth As Integer
    With PastCombo
        .Clear
        For iThreeMonth = 1 To 4
            .AddItem iPastYear & "." & Format(((iThreeMonth - 1) * 3 + 1), "00") & "-" & iPastYear & "." & Format(iThreeMonth * 3, "00")
        Next
        .ListIndex = 0
    End With
End Sub

Private Sub FillYear(PastCombo As ComboBox)
    Dim Rs As New ADODB.Recordset
    Dim strSql As String
    strSql = "SELECT DISTINCT kjyear AS cYear FROM xt_kjrlb"
    Set Rs = Cw_DataEnvi.DataConnect.Execute(strSql)
    PastCombo.Clear
    With Rs
        Do Until .EOF
            PastCombo.AddItem Trim(!cYear)
            .MoveNext
        Loop
    End With
    If PastCombo.ListCount > 0 Then PastCombo.ListIndex = 0
End Sub

⌨️ 快捷键说明

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