📄 frmaddacc.frm
字号:
' txt(11) = frmAccDef.optPC(0).Value
' txt(12) = frmAccDef.optPC(1).Value
' txt(13) = frmAccDef.Chk_LxYt.Value
'
' clsAcc.genadd
' If Len(Text(0).Text) > 0 Then
' frmAccDef.txt(1).Text = Text(0).Text
' Else
' frmAccDef.txt(1).Text = txt(1)
' End If
' frmAccDef.txt(2).Text = txt(2)
' frmAccDef.txt(8).Text = txt(8)
' If Len(Text(1).Text) > 0 Then
' frmAccDef.txt(3).Text = Text(1).Text
' Else
' frmAccDef.txt(3).Text = txt(3)
' Text(1).Text = txt(3)
' iCheck(1) = True
' End If
' If Len(Text(2).Text) = 0 Then
' Text(2).Text = txt(0)
' iCheck(2) = True
' End If
' If Len(Text(3).Text) = 0 Then
' Text(3).Text = txt(1)
' iCheck(3) = True
' End If
' frmAccDef.txt(4).Text = txt(4)
' frmAccDef.txt(5).Text = txt(5)
' frmAccDef.txt(6).Text = txt(6)
' frmAccDef.txt(9).Text = txt(9)
' If IsNumeric(txt(7)) Then frmAccDef.cobSrc.ListIndex = CInt(txt(7))
' If CInt(txt(7)) = 1 Then frmAccDef.cobSrc.ListIndex = 0
' If IsNumeric(txt(10)) Then frmAccDef.Combo1.ListIndex = CInt(txt(10))
' If IsNumeric(txt(11)) Then frmAccDef.optPC(0).Value = CBool(txt(11))
' If IsNumeric(txt(12)) Then frmAccDef.optPC(1).Value = CBool(txt(12))
' If CBool(txt(12)) Then frmAccDef.optPC(0).Value = CBool(txt(12))
' If IsNumeric(txt(13)) Then frmAccDef.Chk_LxYt.Value = txt(13)
' If nwb Then
' frmAccDef.optIE(1).Value = True
' Else
' frmAccDef.optIE(0).Value = True
' End If
' If Not Visible Then frmAccDef.txt(1).Text = txt(1): frmAccDef.txt(3).Text = txt(3)
' frmAccDef.RefCmd1.Enabled = False
' AddAccDef = True
End Function
Public Sub ShowAddAcc(sAcc As String, sUnitName As String)
If bfrmAddAccVisible Then
Me.Text(0).Text = sAcc
Me.Text(2).Text = sUnitName
Text_GotFocus 1
If Len(sUnitName) = 0 Then Text_GotFocus 2
Text_GotFocus 3
Me.Show vbModal
Else
Unload Me
End If
End Sub
Private Sub Command3_Click()
' 'Dim i As Integer 'cuidong 2001.10.24
' Dim i As Long 'cuidong 2001.10.24
' bfrmAddAccVisible = False
' bfrmAccDefVisible = False
' 'frmAccDef.bAddAcc = True
' AddAccDef False
' frmAccDef.txt(1).Enabled = True
' frmAccDef.txt(3).Enabled = True
' frmAccDef.RefCmd1.Enabled = True
' frmAccDef.cmdOk.Visible = True
'
' If Not frmAccDef.Visible Then Unload frmAccDef
'
' i = SetParent(frmAccDef.Picture1.hWnd, frmAccDef.hWnd)
' frmAccDef.Picture1.Top = frmAccDef.tvAccDef.Top
' frmAccDef.Picture1.Left = frmAccDef.tvAccDef.Width + 60
' frmAccDef.Form_Resize
'
' Unload Me
End Sub
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Me.Width = 5895 ' 5895
Me.Height = 1890 ' 6450
CenterForm Me
Screen.MousePointer = vbDefault
'frmAccDef.bAddAcc = True
iCheck(1) = False
iCheck(2) = False
iCheck(3) = False
If frmAccDef.Visible Then WindowsState = frmAccDef.WindowState: frmAccDef.WindowState = 1
End Sub
Private Sub Form_Resize()
' Me.Picture1.Width = Me.ScaleWidth - 0 ' Me.Picture1.Left
' If Me.ScaleHeight > 1500 Then Me.Picture1.Height = Me.ScaleHeight - 1500 ' Me.Picture1.Top
' If bfrmAccDefVisible Then
' frmAccDef.Picture1.Width = Me.Picture1.Width
' frmAccDef.Picture1.Height = Me.Picture1.Height
' End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Command3_Click
frmAccDef.WindowState = WindowsState
On Error Resume Next
Unload frmAccDef
End Sub
Private Sub RefCmd1_Initialize()
RefCmd1.InitSys RefWksDB, dbsZJ
RefCmd1.InitSys RefPara1, Text(1)
End Sub
Private Sub RefCmd1_RefCancel()
Text(1).SetFocus
End Sub
Private Sub RefCmd1_RefOK(Code As String)
' Text(1) = Code
' Text(1).SetFocus
' iCheck(1) = True
' If frmAccDef.Picture1.Visible Then
' frmAccDef.txt(3).Text = Text(1).Text
' End If
End Sub
Private Sub RefCmd2_Initialize()
RefCmd2.InitSys 0, dbsZJ
RefCmd2.InitSys 1, Text(2)
End Sub
Private Sub RefCmd2_RefCancel()
Text(2).SetFocus
End Sub
Private Sub RefCmd2_RefOK(Code As String)
Text(2) = Code
Text(2).SetFocus
iCheck(2) = True
End Sub
Private Sub RefCmd3_Initialize()
RefCmd3.InitSys 0, dbsZJ
RefCmd3.InitSys 1, Text(3).Text
RefCmd3.InitSys 2, Text(2).Text
End Sub
Private Sub RefCmd3_RefCancel()
Text(3).SetFocus
End Sub
Private Sub RefCmd3_RefOK(Code As String)
Text(3) = Code
Text(3).SetFocus
iCheck(2) = True
iCheck(3) = True
Text_LostFocus (3)
AddAccDef
End Sub
Private Sub Text_GotFocus(Index As Integer)
Dim Rs As New UfRecordset
Dim rs1 As New UfRecordset
If Len(Text(Index).Text) = 0 Then
Select Case Index
Case 1
Set Rs = dbsZJ.OpenRecordset("Select cIntrID From FD_Intra order by iid", dbOpenDynaset)
With Rs
If Not (.EOF Or .BOF) Then
Text(Index).Text = !cIntrID
iCheck(Index) = True
Else
iCheck(Index) = False
End If
.oClose
End With
Set Rs = Nothing
Case 2
If nwb Then
Set Rs = dbsZJ.OpenRecordset("Select cUnitName From FD_AccUnit where iType=2" & " order by cUnitCode", dbOpenDynaset)
Else
Set Rs = dbsZJ.OpenRecordset("Select cUnitName From FD_AccUnit where iType<>2" & " order by cUnitCode", dbOpenDynaset)
End If
With Rs
If Not (.EOF Or .BOF) Then
Text(Index).Text = !cUnitName
iCheck(Index) = True
Else
iCheck(Index) = False
End If
.oClose
End With
Set Rs = Nothing
Case 3
Dim sUnitCode As String
If Len(Text(2).Text) <> 0 Then
Set Rs = dbsZJ.OpenRecordset("Select cUnitCode From FD_AccUnit Where cUnitName='" & Text(2).Text & "'", dbOpenDynaset)
With Rs
If Not (.EOF Or .BOF) Then
sUnitCode = !cUnitCode
iCheck(2) = True
Else
iCheck(2) = False
End If
End With
Else
iCheck(2) = False
End If
If iCheck(2) Then
Set Rs = dbsZJ.OpenRecordset("Select cAccID From FD_AccDef Where cUnitCode='" & sUnitCode & "' and iio='" & Abs(CInt(nwb)) & "' order by cAccID", dbOpenDynaset)
With Rs
If Not (.EOF Or .BOF) Then
Text(Index).Text = !cAccID
iCheck(Index) = True
.oClose
Else
iCheck(Index) = False
End If
End With
Set Rs = Nothing
Else
Set Rs = dbsZJ.OpenRecordset("Select cAccID,cUnitCode From FD_AccDef Where iio='" & Abs(CInt(nwb)) & "' order by cAccID", dbOpenDynaset)
With Rs
If Not (.EOF Or .BOF) Then
.MoveFirst
Set rs1 = dbsZJ.OpenRecordset("Select cUnitName From FD_AccUnit Where cUnitCode='" & !cUnitCode & "'", dbOpenDynaset)
With rs1
If Not (.EOF Or .BOF) Then
Text(2).Text = !cUnitName
iCheck(2) = True
Else
iCheck(2) = False
End If
.oClose
End With
Set rs1 = Nothing
Text(Index).Text = !cAccID
iCheck(Index) = True
.oClose
Else
iCheck(Index) = False
End If
End With
Set Rs = Nothing
End If
End Select
End If
End Sub
Private Sub Text_LostFocus(Index As Integer)
' Dim Rs As New UfRecordset
' Dim rs1 As New UfRecordset
' If Len(Text(Index).Text) <> 0 Then
' Select Case Index
' Case 3
' Set Rs = dbsZJ.OpenRecordset("Select cUnitCode From FD_AccDef Where cAccID='" & Text(Index).Text & "'", dbOpenDynaset)
' With Rs
' If Not (.EOF Or .BOF) Then
' Set rs1 = dbsZJ.OpenRecordset("Select cUnitName From FD_AccUnit Where cUnitCode='" & !cUnitCode & "'", dbOpenDynaset)
' With rs1
' If Not (.EOF Or .BOF) Then
' Text(2).Text = !cUnitName
' End If
' .oClose
' End With
' Set rs1 = Nothing
' iCheck(Index) = True
' Else
' MsgBox "账户号不存在!", vbInformation, zjGl_Name
' iCheck(Index) = False
' End If
' .oClose
' End With
' Set Rs = Nothing
' Case 2
' Set Rs = dbsZJ.OpenRecordset("Select * From FD_AccUnit Where cUnitName='" & Text(Index).Text & "'", dbOpenDynaset)
' With Rs
' If Not (.EOF Or .BOF) Then
' 'frmAccDef.tvAccDef.Nodes("u" & !cUnitCode).Selected = True
' iCheck(Index) = True
' Else
' MsgBox "单位名称不存在!", vbInformation, zjGl_Name
' iCheck(Index) = False
' End If
' .oClose
' End With
' Set Rs = Nothing
' Case 1
' If IntrCodeExist(Text(Index).Text) Then
' iCheck(Index) = True
' Else
' iCheck(Index) = False
' MsgBox "利率不存在!", vbInformation, zjGl_Name
' End If
' Case 0
' If frmAccDef.Picture1.Visible Then frmAccDef.txt(1).Text = Text(0).Text
' End Select
' End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -