📄 frmac_generalselect.frm
字号:
' txtLevelFrom.Enabled = False
txtLevelTo.Enabled = False
' UplevelFrom.Enabled = False
upLevelTo.Enabled = False
Else
' txtLevelFrom.Enabled = True
txtLevelTo.Enabled = True
' UplevelFrom.Enabled = True
upLevelTo.Enabled = True
End If
End Sub
Private Sub chkEndLevelSubject_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub ChkIncludeNotRecord_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub cmdHelp_Click()
Call ShowHelp
End Sub
Private Sub cmdCancel_Click()
Me.Hide
End Sub
Private Sub cmdSubjectStart_Click()
With frmUSU_GeneralKmHelp
If .ubSelAll = True Then Unload frmUSU_GeneralKmHelp
.usCondition = " kmjc=1"
.ubSelAll = False
.Show 1
If .Valid Then
txtSubjectStart.text = .SubjectCode & "=" & .SubjectName
End If
Unload frmUSU_GeneralKmHelp
End With
End Sub
Private Sub form_load()
'求最大的级次
Dim iMaxLevel As Integer
''''
'注册表
Me.ChkIncludeNotRecord.Value = Abs(CBool(GetSetting(App.Title, "Settings\frmAc_GeneralSelect", "NotRecord", True)))
Set CSubject = New clsSubject
OK = False
'iMaxLevel = uGetMaxJc()
txtLevelFrom.text = 1
UplevelFrom.Min = 1
upLevelTo.Min = 1
'设置最大级次
iMaxLevel = uGetMaxJc()
txtLevelTo.text = 1
UplevelFrom.Max = iMaxLevel
upLevelTo.Max = iMaxLevel
' upLevelTo.Increment = 1
' UplevelFrom.Increment = 1
'txtSubjectStart.SetFocus
End Sub
Private Sub txtLevelTo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtSubjectEnd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtSubjectstart_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown As Boolean
CtrlDown = (Shift And vbCtrlMask) > 0
If KeyCode = vbKeyF And CtrlDown Then
Call cmdSubjectStart_Click
End If
End Sub
Private Sub cmdSubjectEnd_Click()
With frmUSU_GeneralKmHelp
If .ubSelAll = True Then Unload frmUSU_GeneralKmHelp
.usCondition = " kmjc=1"
.ubSelAll = False
.Show 1
If .Valid Then
txtSubjectEnd.text = .SubjectCode & "=" & .SubjectName
End If
Unload frmUSU_GeneralKmHelp
End With
End Sub
Private Sub txtSubjectend_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown As Boolean
CtrlDown = (Shift And vbCtrlMask) > 0
If KeyCode = vbKeyF And CtrlDown Then
Call cmdSubjectEnd_Click
End If
End Sub
Private Sub txtSubjectStart_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub UplevelFrom_DownClick()
If Val(txtLevelFrom.text) > 1 Then
txtLevelFrom.text = Val(txtLevelFrom) - 1
Else
txtLevelFrom.text = 1
End If
End Sub
Private Sub UplevelFrom_UpClick()
If Val(txtLevelFrom.text) < Val(txtLevelTo.text) Then
txtLevelFrom.text = Val(txtLevelFrom.text) + 1
Else
txtLevelFrom.text = Val(txtLevelTo.text)
End If
End Sub
Private Sub upLevelTo_DownClick()
If Val(txtLevelTo.text) > Val(txtLevelFrom.text) Then
txtLevelTo.text = Val(txtLevelTo.text) - 1
Else
txtLevelTo.text = Val(txtLevelTo.text)
End If
End Sub
Private Sub upLevelTo_UpClick()
If Val(txtLevelTo.text) < upLevelTo.Max Then
txtLevelTo.text = Val(txtLevelTo.text) + 1
Else
txtLevelTo.text = upLevelTo.Max
End If
End Sub
Private Sub cmdOk_Click()
Dim iTemp As Integer
Dim sKmdm As String
If SqlStringValid(txtSubjectStart.text) = False Then
MsgBox "起始科目不能含有非法的字符!", vbInformation, "提示"
Exit Sub
End If
If SqlStringValid(txtSubjectEnd.text) = False Then
MsgBox "终止科目不能含有非法的字符!", vbInformation, "提示"
Exit Sub
End If
'检查起始科目
If Trim$("" & txtSubjectStart.text) <> "" Then
iTemp = InStr(1, txtSubjectStart.text, "=")
If iTemp <> 0 Then
sKmdm = Left(Trim(txtSubjectStart.text), iTemp - 1)
' If getKmJc(Trim$("" & sKmdm)) = 0 Then
CSubject.Init Left$(Trim$("" & txtSubjectStart.text), iTemp - 1), glo.sOperateYear
' Else
' MsgBox "起始科目输入不正确,此输入只能为一级科目!", vbInformation
' txtSubjectStart.SelStart = 0
' txtSubjectStart.SelLength = Len(txtSubjectStart.text)
' txtSubjectStart.SetFocus
' Exit Sub
' End If
Else
' If getKmJc(Trim$("" & txtSubjectStart.text)) = 0 Then
CSubject.Init Trim$("" & txtSubjectStart.text), glo.sOperateYear
' Else
' MsgBox "起始科目输入不正确,此输入只能为一级科目!", vbInformation
' txtSubjectStart.SelStart = 0
' txtSubjectStart.SelLength = Len(txtSubjectStart.text)
' txtSubjectStart.SetFocus
' Exit Sub
' End If
End If
If Not CSubject.SubjectIsExist Then
MsgBox "起始科目输入不正确!", vbInformation
txtSubjectStart.SelStart = 0
txtSubjectStart.SelLength = Len(txtSubjectStart.text)
txtSubjectStart.SetFocus
Exit Sub
End If
m_sSubjectCodeStart = CSubject.SubjectCode
m_sSubjectNameStart = CSubject.SubjectName
Else
m_sSubjectCodeStart = ""
m_sSubjectNameStart = ""
End If
'检查终止科目
If Trim$("" & txtSubjectEnd.text) <> "" Then
iTemp = InStr(1, txtSubjectEnd.text, "=")
If iTemp <> 0 Then
sKmdm = Left(Trim(txtSubjectEnd.text), iTemp - 1)
' If getKmJc(sKmdm) = 0 Then
CSubject.Init Left$(Trim$("" & sKmdm), iTemp - 1), glo.sOperateYear
' Else
' MsgBox "终止科目输入不正确,此输入只能为一级科目!", vbInformation
' txtSubjectEnd.SelStart = 0
' txtSubjectEnd.SelLength = Len(txtSubjectEnd.text)
' txtSubjectEnd.SetFocus
' End If
Else
' If getKmJc(Trim$("" & txtSubjectEnd.text)) = 0 Then
CSubject.Init Trim$("" & txtSubjectEnd.text), glo.sOperateYear
' Else
'
' MsgBox "终止科目输入不正确,此输入只能为一级科目!", vbInformation
' txtSubjectEnd.SelStart = 0
' txtSubjectEnd.SelLength = Len(txtSubjectEnd.text)
' txtSubjectEnd.SetFocus
' Exit Sub
' End If
End If
If Not CSubject.SubjectIsExist Then
MsgBox "终止科目输入不正确!", vbInformation
txtSubjectEnd.SelStart = 0
txtSubjectEnd.SelLength = Len(txtSubjectEnd.text)
txtSubjectEnd.SetFocus
Exit Sub
End If
m_sSubjectCodeEnd = CSubject.SubjectCode
m_sSubjectNameEnd = CSubject.SubjectName
Else
m_sSubjectCodeEnd = ""
m_sSubjectNameEnd = ""
End If
'检查开始科目代码是否小于等于终止科目
If m_sSubjectCodeEnd <> "" Then
If Trim(m_sSubjectCodeStart > m_sSubjectCodeEnd) Then
MsgBox "起始科目编码要小于等于终止科目编码!", vbInformation
txtSubjectStart.SetFocus
txtSubjectStart.SelStart = 0
txtSubjectStart.SelLength = Len(txtSubjectStart.text)
Exit Sub
End If
End If
'设置起始和终止级次
m_iSubjectJcStart = txtLevelFrom.text
m_iSubjectJcEnd = txtLevelTo.text
If chkEndLevelSubject.Value = 1 Then
m_bSubjectJcFlag = True
Else
m_bSubjectJcFlag = False
End If
'设置未记账模块变量
If ChkIncludeNotRecord.Value = 1 Then
m_bNotRecordFlag = True
Else
m_bNotRecordFlag = False
End If
OK = True
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -