📄 序时帐查询.frm
字号:
End If
End If
End Sub
Private Sub Edit2_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Command1(1).Value = True
Edit2.SetFocus
End If
End Sub
Private Sub Edit2_LostFocus()
If Edit2 <> "" Then
Edit2 = ForDate(Edit2)
If Not IsDate(Edit2) Then
Beep
MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
SetTxtFocus Edit2
End If
End If
End Sub
Private Sub Edit3_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
RefCmd1(0).RunReference
Edit3.SetFocus
End If
End Sub
Private Sub Edit4_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
RefCmd1(1).RunReference
Edit4.SetFocus
End If
End Sub
Private Sub Form_Load()
Me.Height = 2820
Me.width = 5415
LoadStatic
CenterForm Me
End Sub
'********************************************************************
'*函数说明: 加载资源 *
'*参 数: *
'* *
'*返回值 : *
'*********************************************************************
Private Sub LoadStatic()
Me.Icon = LoadResPicture(109, vbResIcon)
Command2(0).Picture = LoadResPicture(103, vbResBitmap)
Command2(1).Picture = LoadResPicture(104, vbResBitmap)
Command1(0).Picture = LoadResPicture(1108, vbResBitmap)
Command1(1).Picture = LoadResPicture(1108, vbResBitmap)
End Sub
'********************************************************************
'*函数说明: 验证输入条件并产生 SQL 语句 *
'*参 数: *
'* *
'*返回值 : True : 成功 *
'*********************************************************************
Private Function CheckValid() As Boolean
Dim bWhere As Boolean
Dim strTemp As String
Dim strPTemp As String
Dim strGTemp As String
Dim strWhole As String
Dim sqlPWhere As String
Dim sqlGWhere As String
CheckValid = False
sqlWhere = "": sqlPWhere = "": sqlGWhere = "": sqlWhole = ""
' 日期
If Edit1 <> "" Then
Edit1 = ForDate(Edit1)
If IsDate(Edit1) Then
sqlWhere = " WHERE [dbill_date] >= '" & FormatDate(Edit1) & "' "
sqlWhole = " [dbill_date] >= '" & FormatDate(Edit1) & "' "
bWhere = True
Else
Beep
MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
SetTxtFocus Edit1
Exit Function
End If
End If
If Edit2 <> "" Then
Edit2 = ForDate(Edit2)
If IsDate(Edit2) Then
strTemp = " [dbill_date] <= '" & FormatDate(Edit2) & "' "
If bWhere Then
sqlWhere = sqlWhere & "AND" & strTemp
sqlWhole = sqlWhole & "AND" & strTemp
Else
bWhere = True
sqlWhere = " WHERE" & strTemp
sqlWhole = strTemp
End If
Else
Beep
MsgBox "日期非法,请检查!", vbInformation, zjGl_Name
SetTxtFocus Edit2
Exit Function
End If
End If
sqlPWhere = sqlWhere
sqlGWhere = sqlWhere
' 账户号
If Edit4 <> "" Then
strTemp = " [cAccID] LIKE '" & Edit4 & "' "
strPTemp = " [cPAccID] LIKE '" & Edit4 & "' "
strGTemp = " [cGAccID] LIKE '" & Edit4 & "' "
strWhole = " (" & strPTemp & "OR" & strGTemp & ") "
If bWhere Then
sqlWhere = sqlWhere & "AND" & strTemp
sqlPWhere = sqlPWhere & "AND" & strPTemp
sqlGWhere = sqlGWhere & "AND" & strGTemp
sqlWhole = sqlWhole & "AND" & strWhole
Else
bWhere = True
sqlWhere = " WHERE" & strTemp
sqlPWhere = " WHERE" & strPTemp
sqlGWhere = " WHERE" & strGTemp
sqlWhole = strWhole
End If
End If
'单位名称
If Edit3 <> "" Then
strTemp = " IN (SELECT transactions_id,[cAccID] FROM FD_AccDef " & _
"INNER JOIN FD_AccUnit ON FD_AccDef.[cUnitCode]=FD_AccUnit.[cUnitCode] " & _
"WHERE FD_AccUnit.[cUnitName] LIKE '" & Edit3 & "') "
strPTemp = " [cPAccID]" & strTemp
strGTemp = " [cGAccID]" & strTemp
strWhole = " ( [cPAccID]" & strTemp & "OR [cGAccID]" & strTemp & ") "
strTemp = " [cAccID]" & strTemp
If bWhere Then
sqlWhere = sqlWhere & "AND" & strTemp
sqlPWhere = sqlPWhere & "AND" & strPTemp
sqlGWhere = sqlGWhere & "AND" & strGTemp
sqlWhole = sqlWhole & "AND" & strWhole
Else
bWhere = True
sqlWhere = " WHERE" & strTemp
sqlPWhere = " WHERE" & strPTemp
sqlGWhere = " WHERE" & strGTemp
sqlWhole = strWhole
End If
End If
Dim sqlSetPWhere As String
Dim sqlSetGWhere As String
Dim sqlSetWhere As String
Dim sqlSet11 As String
sqlSet11 = ""
sqlSetPWhere = "[cSetID] LIKE '15%'"
sqlSetGWhere = "[cSetID] LIKE '15%'"
sqlSetWhere = "[cSetID] LIKE '14%'"
If sqlPWhere = "" Then
sqlSetPWhere = " WHERE " & sqlSetPWhere
sqlSetGWhere = " WHERE " & sqlSetGWhere
sqlSetWhere = " WHERE " & sqlSetWhere
Else
sqlSetPWhere = sqlPWhere & "AND " & sqlSetPWhere
sqlSetGWhere = sqlGWhere & "AND " & sqlSetGWhere
sqlSetWhere = sqlPWhere & "AND " & sqlSetWhere
If Edit3.Text <> "" Or Edit4.Text <> "" Then
sqlSet11 = sqlGWhere & "AND [cSetID] LIKE '14%'"
End If
End If
'cuidong S.A 2001.09.11
'-----------------------------------------------
' strFind = "SELECT transactions_id,[cAccID] AS AccID, [dbill_date] AS BillDate, [cdigest] AS Digest, [cCreID] AS YWID, [mmoney] AS mC, 0 AS mD From FD_Cred" & sqlWhere & _
' " UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cRetID], 0, [mmoney] From FD_Return" & sqlWhere & _
' " UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cCraID], 0, [mmoney] From FD_CreAcrRcp" & sqlWhere & _
' " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cCarID], [mmoney], 0 From FD_CadAcr" & sqlGWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cCarID], 0, [mmoney] From FD_CadAcr" & sqlPWhere & _
' " UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cFetID], 0, [mmoney] From FD_Fetch" & sqlWhere & _
' " UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cSavID], [mmoney], 0 From FD_Sav" & sqlWhere & _
' " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cSetID], [mmoney], 0 From FD_SettAcc" & sqlSetGWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cSetID], 0, [mmoney] From FD_SettAcc" & sqlSetPWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cSetID], (case when igp_flag=0 then [mmoney] else 0 end), (case when igp_flag=0 then 0 else [mmoney] end) From FD_SettAcc" & sqlSetWhere
strFind = "SELECT transactions_id,[cAccID] AS AccID, [dbill_date] AS BillDate, [cdigest] AS Digest, [cCreID] AS YWID, [mmoney] AS mC, 0 AS mD, nFrat From FD_Cred" & sqlWhere & _
" UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cRetID], 0, [mmoney], nFrat From FD_Return" & sqlWhere & _
" UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cCraID], 0, [mmoney], nFrat From FD_CreAcrRcp" & sqlWhere & _
" UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cCarID], [mmoney], 0, nFrat From FD_CadAcr" & sqlGWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cCarID], 0, [mmoney], nFrat From FD_CadAcr" & sqlPWhere & _
" UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cFetID], 0, [mmoney], nFrat From FD_Fetch" & sqlWhere & _
" UNION ALL SELECT transactions_id,[cAccID], [dbill_date], [cdigest], [cSavID], [mmoney], 0, nFrat From FD_Sav" & sqlWhere & _
" UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cSetID], [mmoney], 0, nFrat From FD_SettAcc" & sqlSetGWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cSetID], 0, [mmoney], nFrat From FD_SettAcc" & sqlSetPWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cSetID], (case when igp_flag=0 then [mmoney] else 0 end), (case when igp_flag=0 then 0 else [mmoney] end), nFrat From FD_SettAcc" & sqlSetWhere
'-----------------------------------------------
If sqlSet11 <> "" Then
strFind = strFind & " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cSetID], (case when igp_flag=0 then [mmoney] else 0 end), (case when igp_flag=0 then 0 else [mmoney] end), nFrat From FD_SettAcc" & sqlSet11
End If
'cuidong S.A 2001.09.11
'-----------------------------------------------
' strFind = strFind & _
' " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cUnwID], [mmoney], 0 From FD_UnwDeb" & sqlGWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cUnwID], 0, [mmoney] From FD_UnwDeb" & sqlPWhere & _
' " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cUnaID], [mmoney], 0 From FD_UnwAcrRcp" & sqlGWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cUnaID], 0, [mmoney] From FD_UnwAcrRcp" & sqlPWhere & _
' " UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cRetID], [mmoney], 0 From FD_UnwRet" & sqlGWhere & _
' " UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cRetID], 0, [mmoney] From FD_UnwRet" & sqlPWhere & _
' " ORDER BY [BillDate], YWID"
strFind = strFind & _
" UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cUnwID], [mmoney], 0, nFrat From FD_UnwDeb" & sqlGWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cUnwID], 0, [mmoney], nFrat From FD_UnwDeb" & sqlPWhere & _
" UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cUnaID], [mmoney], 0, nFrat From FD_UnwAcrRcp" & sqlGWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cUnaID], 0, [mmoney], nFrat From FD_UnwAcrRcp" & sqlPWhere & _
" UNION ALL SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cRetID], [mmoney], 0, nFrat From FD_UnwRet" & sqlGWhere & _
" UNION ALL SELECT transactions_id,[cPAccID], [dbill_date], [cdigest], [cRetID], 0, [mmoney], nFrat From FD_UnwRet" & sqlPWhere & _
" ORDER BY [BillDate], YWID"
'-----------------------------------------------
'" UNION SELECT transactions_id,[cGAccID], [dbill_date], [cdigest], [cSetID], IIf(igp_flag=0,[mmoney],0), IIf(igp_flag=0,0,[mmoney]) From FD_SettAcc" & sqlSetWhere & _
CheckValid = True
Dim iV As Variant
iV = InStr(1, sqlWhere, " WHERE", vbTextCompare)
If iV <> 0 Then
sqlWhere = " AND" & right(sqlWhere, Len(sqlWhere) - 6)
sqlWhole = " AND" & sqlWhole
End If
End Function
Private Sub Form_Unload(Cancel As Integer)
If Quitfs Then
zjLogInfo.TaskExec "FD0706", 0, zjLogInfo.cIYear
zjLogInfo.ClearError
zjGen_arr.FD0706 = False
End If
End Sub
Private Sub RefCmd1_Initialize(Index As Integer)
Select Case Index
Case 0:
RefCmd1(Index).InitSys 0, dbsZJ
RefCmd1(Index).InitSys 1, Edit3
Case 1: Edit4.SetFocus
RefCmd1(Index).InitSys 0, dbsZJ
RefCmd1(Index).InitSys 1, Edit4
RefCmd1(Index).InitSys 2, Edit3
End Select
End Sub
Private Sub RefCmd1_RefCancel(Index As Integer)
Select Case Index
Case 0: Edit3.SetFocus
Case 1: Edit4.SetFocus
End Select
End Sub
Private Sub RefCmd1_RefOK(Index As Integer, Code As String)
Select Case Index
Case 0: Edit3 = Code: Edit3.SetFocus
Case 1: Edit4 = Code: Edit4.SetFocus
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -