📄
字号:
VERSION 5.00
Begin VB.Form Bbfx_SelDate2
BorderStyle = 3 'Fixed Dialog
Caption = "分析期选择"
ClientHeight = 2520
ClientLeft = 45
ClientTop = 330
ClientWidth = 4350
KeyPreview = -1 'True
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2520
ScaleWidth = 4350
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame2
Caption = "比较期"
Height = 960
Index = 1
Left = 1680
TabIndex = 12
Top = 1110
Width = 2595
Begin VB.ComboBox Combo_CompDate
BackColor = &H8000000B&
Enabled = 0 'False
Height = 300
Index = 0
Left = 195
Style = 2 'Dropdown List
TabIndex = 6
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 = 7
Top = 555
Width = 2295
End
End
Begin VB.CommandButton YdCommand
Caption = "取消(&C)"
Height = 300
Index = 1
Left = 3155
TabIndex = 9
Top = 2160
Width = 1120
End
Begin VB.CommandButton YdCommand
Caption = "确定(&O)"
Height = 300
Index = 0
Left = 1935
TabIndex = 8
Top = 2160
Width = 1120
End
Begin VB.Frame Frame2
Caption = "分析期"
Height = 960
Index = 0
Left = 1680
TabIndex = 11
Top = 75
Width = 2595
Begin VB.ComboBox Combo_Date
Height = 300
Index = 1
Left = 180
Style = 2 'Dropdown List
TabIndex = 5
Top = 555
Width = 2325
End
Begin VB.ComboBox Combo_Date
Height = 300
Index = 0
Left = 180
Style = 2 'Dropdown List
TabIndex = 4
Top = 210
Width = 2325
End
End
Begin VB.Frame Frame1
Caption = "类别选择"
Height = 2010
Left = 75
TabIndex = 10
Top = 45
Width = 1575
Begin VB.CheckBox chk_ComSel
Caption = "选择比较期"
Height = 270
Left = 210
TabIndex = 3
Top = 1620
Width = 1215
End
Begin VB.OptionButton DateType
Caption = "按年"
Height = 255
Index = 2
Left = 195
TabIndex = 2
Top = 1125
Width = 945
End
Begin VB.OptionButton DateType
Caption = "按季"
Height = 255
Index = 1
Left = 195
TabIndex = 1
Top = 690
Width = 945
End
Begin VB.OptionButton DateType
Caption = "按月"
Height = 255
Index = 0
Left = 195
TabIndex = 0
Top = 255
Width = 945
End
End
End
Attribute VB_Name = "Bbfx_SelDate2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************
'* 模 块 名 称 :报表分析条件
'* 功 能 描 述 :报表的分析条件
'* 程序员姓名 : 魏永生
'* 最后修改人 :
'* 最后修改时间:2002/1/15
'* 备 注:
'* 报表分析/对比分析
'* 报表分析/结构分析
'*************************************************************
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 Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
Dim jdzygs As Integer '控件焦点转移个数
jdzygs = 10
Select Case KeyAscii
Case vbKeyReturn
If Kjjdzy(jdzygs) Then
KeyAscii = 0
End If
Case 39 '屏蔽"'"
KeyAscii = 0
End Select
End Sub
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
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))
End If
Case 2 '年
iThisYear = Combo_Date(0).Text
If chk_ComSel.Value = 1 Then
iCompYear = Combo_CompDate(0).Text
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 gy_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 + -