📄 frmfi_usuzzformula.frm
字号:
VERSION 5.00
Begin VB.Form frmFI_UsuZzFormula
BorderStyle = 3 'Fixed Dialog
Caption = "自定义公式向导"
ClientHeight = 3825
ClientLeft = 45
ClientTop = 330
ClientWidth = 5160
Icon = "frmFI_UsuZzFormula.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3825
ScaleWidth = 5160
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtXm
Height = 285
Left = 1080
TabIndex = 15
Top = 2490
Width = 1695
End
Begin VB.CommandButton cmdXmHelp
Height = 300
Left = 2880
Picture = "frmFI_UsuZzFormula.frx":0442
Style = 1 'Graphical
TabIndex = 14
Top = 2490
Width = 375
End
Begin VB.TextBox txtBm
Height = 285
Left = 1080
TabIndex = 12
Top = 2010
Width = 1695
End
Begin VB.CommandButton cmdBmHelp
Height = 300
Left = 2880
Picture = "frmFI_UsuZzFormula.frx":0974
Style = 1 'Graphical
TabIndex = 11
Top = 2010
Width = 375
End
Begin VB.CommandButton cmdPrev
Caption = "上一步"
Height = 345
Left = 1395
TabIndex = 10
Top = 3360
Width = 1065
End
Begin VB.CommandButton cmdOK
Caption = "完成(&F)"
Height = 345
Left = 2640
TabIndex = 6
Top = 3360
Width = 1065
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 345
Left = 3960
TabIndex = 7
Top = 3360
Width = 1065
End
Begin VB.CommandButton cmdKMHelp
Height = 300
Left = 2880
Picture = "frmFI_UsuZzFormula.frx":0EA6
Style = 1 'Graphical
TabIndex = 8
Top = 360
Width = 375
End
Begin VB.ComboBox cboFx
Height = 300
Left = 1080
TabIndex = 5
Top = 1500
Width = 1815
End
Begin VB.ComboBox cboQJ
Height = 300
Left = 1080
TabIndex = 3
Top = 930
Width = 1815
End
Begin VB.TextBox txtKm
Height = 285
Left = 1080
TabIndex = 1
Top = 360
Width = 1695
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "项目(&X):"
Height = 180
Left = 240
TabIndex = 16
Top = 2550
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "部门(&B):"
Height = 180
Left = 240
TabIndex = 13
Top = 2070
Width = 810
End
Begin VB.Label lblFormula
AutoSize = -1 'True
Caption = "公式:"
Height = 180
Left = 480
TabIndex = 9
Top = 2910
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "方向(&D):"
Height = 180
Left = 240
TabIndex = 4
Top = 1530
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "期间(&Q):"
Height = 180
Left = 240
TabIndex = 2
Top = 975
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "科目(&K):"
Height = 180
Left = 240
TabIndex = 0
Top = 420
Width = 810
End
End
Attribute VB_Name = "frmFI_UsuZzFormula"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Public Ok As Boolean
Public GotoPrev As Boolean
Dim aryF(5) As String
Dim m_sFormulaName As String
Dim m_sFormula As String
Dim m_iFx As Integer
Dim m_bPZHJ As Boolean
Public Property Let uiFx(ByVal vNewValue As Integer)
m_iFx = vNewValue
End Property
Public Property Let ubPZHJ(ByVal vNewValue As Boolean)
m_bPZHJ = vNewValue
End Property
Public Property Let usFormulaName(ByVal sName As String)
m_sFormulaName = sName
End Property
Public Property Get usFormula() As String
usFormula = m_sFormula
End Property
Private Sub cboFx_Click()
If cboFx.ListIndex < 0 Then
aryF(3) = ""
Else
aryF(3) = cboFx.List(cboFx.ListIndex)
End If
Call PrintFormula
End Sub
Private Sub cboFx_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
End If
End Sub
Private Sub cboQJ_Click()
If cboQJ.ListIndex < 0 Then
aryF(2) = ""
Else
aryF(2) = cboQJ.List(cboQJ.ListIndex)
End If
Call PrintFormula
End Sub
Private Sub cboQJ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
End If
End Sub
Private Sub cmdCancel_Click()
Ok = False
Me.Hide
End Sub
Private Sub cmdKMHelp_Click()
With frmUSU_KmHelp
.MultiSelNode = False
.ubSelAll = True '任意科目
Load frmUSU_KmHelp
.Show 1
If .SubjectCode <> "" Then
txtKm.text = .SubjectCode
End If
End With
End Sub
Private Sub cmdBmHelp_Click()
With frmUSU_HelpDepartment
Load frmUSU_HelpDepartment
.ubEnableSelectAll = True
.Show 1
If .Ok Then
txtBm.text = .usCode
End If
End With
End Sub
Private Sub cmdXmHelp_Click()
With frmUSU_HelpItem
Load frmUSU_HelpItem
.ubSelAll = True
.Show 1
If .Ok Then
txtXm.text = .usCode
End If
End With
End Sub
Private Sub cmdOk_Click()
Dim i As Long
If Not m_bPZHJ Then
For i = LBound(aryF) To UBound(aryF) - 2
If Trim(aryF(i)) = "" Then
MsgBox "公式不完整!", vbInformation
Exit Sub
End If
If CheckKM() = False Then
MsgBox "科目不存在!", vbExclamation, "提示"
txtKm.SetFocus
Exit Sub
End If
Next i
End If
Ok = True
Me.Hide
End Sub
Private Function CheckKM() As Boolean
Dim rstTmp As New ADODB.Recordset
rstTmp.CursorLocation = adUseClient
rstTmp.Open "select * from tzw_km" & glo.sOperateYear & " where kmdm='" & Trim(txtKm.text) & "'", glo.cnnMain, adOpenStatic, adLockReadOnly
If rstTmp.RecordCount > 0 Then
CheckKM = True
Else
CheckKM = False
End If
End Function
Private Sub PrintFormula()
Dim sTemp As String
Dim i As Long
sTemp = ""
For i = 1 To 5
sTemp = sTemp & chr(34) & aryF(i) & chr(34) & ","
Next i
'' For i = 5 To 8
'' sTemp = sTemp & aryF(i) & ","
'' Next i
sTemp = m_sFormulaName & "(" & Left$(sTemp, Len(sTemp) - 1) & ")"
lblFormula.Caption = "公式:" & vbCr & sTemp
m_sFormula = sTemp
End Sub
Private Sub cmdPrev_Click()
GotoPrev = True
Ok = False
Me.Hide
End Sub
Private Sub form_load()
GotoPrev = False
Call InitCbo
End Sub
Private Sub txtBm_Change()
aryF(4) = Trim(txtBm.text)
Call PrintFormula
End Sub
Private Sub txtKm_Change()
aryF(1) = Trim(txtKm.text)
Call PrintFormula
End Sub
Private Sub InitCbo()
cboFx.Clear
cboQJ.Clear
cboFx.AddItem "借"
cboFx.AddItem "贷"
cboFx.ListIndex = m_iFx
cboQJ.AddItem "月"
cboQJ.AddItem "年"
cboQJ.ListIndex = 0
End Sub
Private Sub txtKm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
End If
End Sub
Private Sub txtXm_Change()
aryF(5) = Trim(txtXm.text)
Call PrintFormula
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -