📄 frmloanfind.frm
字号:
VERSION 5.00
Object = "{A0C292A3-118E-11D2-AFDF-000021730160}#1.0#0"; "UFEDIT.OCX"
Begin VB.Form frmLoanFind
Caption = "查询条件"
ClientHeight = 3390
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3390
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Height = 420
Left = 2520
Style = 1 'Graphical
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.CommandButton Command1
Height = 420
Left = 480
Style = 1 'Graphical
TabIndex = 4
Top = 2880
Width = 1215
End
Begin VB.PictureBox Picture1
Height = 2415
Left = 120
ScaleHeight = 2355
ScaleWidth = 4395
TabIndex = 6
Top = 240
Width = 4455
Begin VB.CheckBox optwjz
Appearance = 0 'Flat
BackColor = &H80000000&
Caption = "包含未记账"
ForeColor = &H00000000&
Height = 375
Left = 1080
MaskColor = &H00E0E0E0&
Picture = "frmLoanFind.frx":0000
TabIndex = 3
Top = 1920
Width = 1335
End
Begin VB.CommandButton Command5
Height = 255
Left = 2640
Style = 1 'Graphical
TabIndex = 13
Top = 1560
Width = 255
End
Begin VB.CommandButton Command4
Height = 255
Left = 2640
Style = 1 'Graphical
TabIndex = 12
Top = 960
Width = 255
End
Begin VB.CommandButton Command3
Height = 255
Left = 3960
Style = 1 'Graphical
TabIndex = 11
Top = 480
Width = 255
End
Begin EDITLib.Edit Edit3
Height = 255
Left = 1080
TabIndex = 2
Top = 1560
Width = 1575
_Version = 65536
_ExtentX = 2778
_ExtentY = 450
_StockProps = 253
ForeColor = 0
BackColor = 16777215
Appearance = 1
End
Begin EDITLib.Edit Edit2
Height = 255
Left = 1080
TabIndex = 1
Top = 960
Width = 1575
_Version = 65536
_ExtentX = 2778
_ExtentY = 450
_StockProps = 253
ForeColor = 0
BackColor = 16777215
Appearance = 1
Property = 5
MaxLength = 10
End
Begin EDITLib.Edit Edit1
Height = 255
Left = 1080
TabIndex = 0
Top = 480
Width = 2895
_Version = 65536
_ExtentX = 5106
_ExtentY = 450
_StockProps = 253
ForeColor = 0
BackColor = 16777215
Appearance = 1
Property = 1
MaxLength = 60
End
Begin VB.Label Label4
Caption = "请输入查询条件"
Height = 255
Left = 1200
TabIndex = 10
Top = 120
Width = 1455
End
Begin VB.Label Label3
Caption = "结束日期"
Height = 255
Left = 120
TabIndex = 9
Top = 1560
Width = 735
End
Begin VB.Label Label2
Caption = "开始日期"
Height = 255
Left = 120
TabIndex = 8
Top = 960
Width = 855
End
Begin VB.Label Label1
Caption = "单位名称"
Height = 255
Left = 120
TabIndex = 7
Top = 480
Width = 735
End
End
End
Attribute VB_Name = "frmLoanFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public loan_or_inter As Integer
Dim qyrq As String
Private Sub Command1_Click()
Dim str As String
str = ""
If Edit1.Text <> "" Then
str = " and fd_accUnit.cUnitname='" & Trim(Edit1.Text) & "' "
End If
If DateCheck(Trim(Edit2.Text)) <> "" And DateCheck(Trim(Edit3.Text)) <> "" Then
If CDate(Trim(Edit2.Text)) > CDate(Trim(Edit3.Text)) Then
MsgBox "结束日期必须大于等于开始日期输入错误", vbInformation, "输入错误"
Exit Sub
End If
End If
If Trim(Edit2.Text) <> "" Then
If DateCheck(Edit2.Text) <> "" Then
If CDate(Trim(Edit2.Text)) >= CDate(qyrq) Then
str = str & " and fd_transactions.bill_date>='" & DateCheck(Edit2.Text) & "'"
Else
MsgBox "开始日期必须大于等于系统启用日期", vbInformation, "输入错误"
Exit Sub
End If
Else
MsgBox "开始日期输入错误", vbInformation, "输入错误"
Exit Sub
End If
End If
If Trim(Edit3.Text) <> "" Then
If DateCheck(Edit3.Text) <> "" Then
If CDate(Trim(Edit3.Text)) <= CDate(zjLogInfo.curDate) Then
str = str & " and fd_transactions.bill_date<='" & DateCheck(Edit3.Text) & "'"
Else
MsgBox "结束日期必须小于等于系统登录日期", vbInformation, "输入错误"
Exit Sub
End If
Else
MsgBox "结束日期输入错误", vbInformation, "输入错误"
Exit Sub
End If
End If
If optwjz.Value = 0 Then
str = str & " and (fd_transactions.book_Name<>'' or fd_transactions.book_Name is not null)"
If loan_or_inter = 1 Then
frmLoanInfor.optwjz = True
ElseIf loan_or_inter = 2 Then
frmInterestInfor.optwjz = True
End If
Else
If loan_or_inter = 1 Then
frmLoanInfor.optwjz = False
ElseIf loan_or_inter = 2 Then
frmInterestInfor.optwjz = False
End If
End If
If loan_or_inter = 1 Then
frmLoanInfor.text1.Caption = Trim(Edit1.Text)
If Trim(Edit2.Text) <> "" Then
frmLoanInfor.lblksrq.Caption = DateCheck(Edit2.Text)
Else
frmLoanInfor.lblksrq.Caption = qyrq
End If
If Trim(Edit3.Text) <> "" Then
frmLoanInfor.lbljsrq.Caption = DateCheck(Edit3.Text)
Else
frmLoanInfor.lbljsrq.Caption = zjLogInfo.curDate
End If
frmLoanInfor.sqlwhere = str
ElseIf loan_or_inter = 2 Then
frmInterestInfor.text1.Caption = Trim(Edit1.Text)
If Trim(Edit2.Text) <> "" Then
frmInterestInfor.lblksrq.Caption = DateCheck(Edit2.Text)
Else
frmInterestInfor.lblksrq.Caption = qyrq
End If
If Trim(Edit3.Text) <> "" Then
frmInterestInfor.lbljsrq.Caption = DateCheck(Edit3.Text)
Else
frmInterestInfor.lbljsrq.Caption = qyrq
End If
frmInterestInfor.sqlwhere = str
End If
loan_or_inter = 0
Unload Me
End Sub
Private Sub Command1_GotFocus()
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
End Sub
Private Sub Command2_Click()
If loan_or_inter = 1 Then
frmLoanInfor.sqlwhere = ""
frmLoanInfor.lblksrq = qyrq
frmLoanInfor.lbljsrq.Caption = zjLogInfo.curDate
ElseIf loan_or_inter = 2 Then
frmInterestInfor.sqlwhere = ""
frmInterestInfor.lblksrq.Caption = qyrq
frmInterestInfor.lbljsrq.Caption = zjLogInfo.curDate
End If
loan_or_inter = 0
Unload Me
End Sub
Private Sub Command2_GotFocus()
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
End Sub
Private Sub Command3_Click()
Dim sqlstr As String
Dim rs1 As New ADODB.Recordset
Dim rfd As New UFReferC.UFReferClient
sqlstr = "select Iid As 序号,cUnitName As 单位名称 from FD_AccUnit order by iid"
rfd.SetLogin zjLogInfo
rfd.SetReferSQLString sqlstr
rfd.SetReferDisplayMode enuGrid
rfd.Show
If rfd.recmx Is Nothing Then Exit Sub
Set rs1 = rfd.recmx
Edit1.Text = rs1(1)
Set rfd = Nothing
Set rs1 = Nothing
End Sub
Private Sub Command4_Click()
Dim Calendar As New CalendarAPP.ICaleCom
Calendar.Caption = "开始日期"
Calendar.DateDivideChar = "-"
Edit2.Text = Calendar.Calendar(Edit2.hWnd)
Set Calendar = Nothing
End Sub
Private Sub Command5_Click()
Dim Calendar As New CalendarAPP.ICaleCom
Calendar.Caption = "结束日期"
Calendar.DateDivideChar = "-"
Edit3.Text = Calendar.Calendar(Edit3.hWnd)
Set Calendar = Nothing
End Sub
Private Sub Edit1_GotFocus()
Command3.Visible = True
Command4.Visible = False
Command5.Visible = False
End Sub
Private Sub Edit1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Command3_Click
ElseIf KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
Edit2.SetFocus
ElseIf KeyCode = vbKeyUp Then
Command2.SetFocus
End If
End Sub
Private Sub Edit2_GotFocus()
Command3.Visible = False
Command4.Visible = True
Command5.Visible = False
End Sub
Private Sub Edit2_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Command4_Click
ElseIf KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
Edit3.SetFocus
ElseIf KeyCode = vbKeyUp Then
Edit1.SetFocus
End If
End Sub
Private Sub Edit2_LostFocus()
If Edit2.Text <> "" Then
Edit2.Text = DateCheck(Trim(Edit2.Text))
End If
End Sub
Private Sub Edit3_GotFocus()
Command3.Visible = False
Command4.Visible = False
Command5.Visible = True
End Sub
Private Sub Edit3_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Command5_Click
ElseIf KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
Command1.SetFocus
ElseIf KeyCode = vbKeyUp Then
Edit2.SetFocus
End If
End Sub
Private Sub Edit3_LostFocus()
If Edit3.Text <> "" Then
Edit3.Text = DateCheck(Trim(Edit3.Text))
End If
End Sub
Private Sub Form_Load()
Dim str As String
Dim rs As New UfRecordset
loadstatic
str = "select option1 from fd_option"
Set rs = dbsZJ.OpenRecordset(str, dbOpenDynamic)
If Not (rs.EOF Or rs.BOF) Then
qyrq = IIf(IsNull(rs(0)), "", rs(0))
qyrq = DateCheck(qyrq)
Else
qyrq = ""
End If
Edit2.Text = qyrq
Edit3.Text = zjLogInfo.curDate
rs.oClose
Set rs = Nothing
End Sub
Private Sub loadstatic()
Command1.Picture = LoadResPicture(103, vbResBitmap)
Command2.Picture = LoadResPicture(104, vbResBitmap)
Command3.Picture = LoadResPicture(129, vbResBitmap)
Command4.Picture = LoadResPicture(1108, vbResBitmap)
Command5.Picture = LoadResPicture(1108, vbResBitmap)
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
End Sub
Private Sub optwjz_GotFocus()
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -