📄 frmshoukuanfind.frm
字号:
VERSION 5.00
Begin VB.Form frmshoukuanfind
BackColor = &H00C0FFFF&
Caption = "收款情况查询"
ClientHeight = 8520
ClientLeft = 60
ClientTop = 450
ClientWidth = 8445
LinkTopic = "Form15"
MaxButton = 0 'False
ScaleHeight = 8520
ScaleWidth = 8445
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox MSHFlexGrid2
Height = 1935
Left = 240
ScaleHeight = 1875
ScaleWidth = 7875
TabIndex = 15
Top = 6240
Width = 7935
End
Begin VB.PictureBox MSHFlexGrid1
Height = 3495
Left = 240
ScaleHeight = 3435
ScaleWidth = 7875
TabIndex = 14
Top = 2280
Width = 7935
End
Begin VB.Frame Frame1
BackColor = &H00C0FFFF&
Caption = "查询条件"
Height = 1935
Left = 240
TabIndex = 0
Top = 240
Width = 7935
Begin VB.CommandButton cmdexit
Caption = "退出"
Height = 375
Left = 5400
TabIndex = 13
Top = 1440
Width = 975
End
Begin VB.CommandButton cmdprint
Caption = "打印"
Height = 375
Left = 2880
TabIndex = 12
Top = 1440
Width = 975
End
Begin VB.CommandButton cmdfind
Caption = "查询"
Height = 375
Left = 600
TabIndex = 11
Top = 1440
Width = 975
End
Begin VB.PictureBox DTPicker2
Height = 255
Left = 3360
ScaleHeight = 195
ScaleWidth = 1395
TabIndex = 9
Top = 960
Width = 1455
End
Begin VB.PictureBox DTPicker1
Height = 255
Left = 1320
ScaleHeight = 195
ScaleWidth = 1395
TabIndex = 8
Top = 960
Width = 1455
End
Begin VB.TextBox txtjkr
Height = 270
Left = 5880
TabIndex = 7
Top = 480
Width = 1335
End
Begin VB.TextBox txtloupannum
Height = 270
Left = 3600
TabIndex = 6
Top = 480
Width = 1215
End
Begin VB.TextBox txtnum
Height = 270
Left = 1320
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.OptionButton Option4
BackColor = &H00C0FFFF&
Caption = "收款时间"
Height = 495
Left = 240
TabIndex = 4
Top = 840
Width = 1095
End
Begin VB.OptionButton Option3
BackColor = &H00C0FFFF&
Caption = "交款人"
Height = 255
Left = 5040
TabIndex = 3
Top = 480
Width = 975
End
Begin VB.OptionButton Option2
BackColor = &H00C0FFFF&
Caption = "楼盘编号"
Height = 375
Left = 2640
TabIndex = 2
Top = 360
Width = 1095
End
Begin VB.OptionButton Option1
BackColor = &H00C0FFFF&
Caption = "收款单号"
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0FFFF&
Caption = "-----"
Height = 375
Left = 2880
TabIndex = 10
Top = 960
Width = 375
End
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "预定付款情况"
Height = 180
Left = 240
TabIndex = 16
Top = 6000
Width = 1080
End
End
Attribute VB_Name = "frmshoukuanfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_shoukuan As New ADODB.Recordset
Dim rs_yushou As New ADODB.Recordset
Dim getrow As Integer
Dim select_row As String
Private Sub Form_Load()
Dim sql As String
On Error GoTo loaderror
sql = "select * from 收款登记"
rs_shoukuan.CursorLocation = adUseClient
rs_shoukuan.Open sql, conn, adOpenKeyset, adLockPessimistic '打开数据库
setgrid1
setgridhead
displaygrid
rs_shoukuan.Close
Exit Sub
loaderror:
MsgBox Err.Description
End Sub
Public Sub displaygrid()
Dim i As Integer
On Error GoTo displayerror
MSHFlexGrid1.Row = 0
If Not rs_shoukuan.EOF Then
rs_shoukuan.MoveFirst
Do While Not rs_shoukuan.EOF
MSHFlexGrid1.Row = MSHFlexGrid1.Row + 1
For i = 0 To 7
MSHFlexGrid1.Col = i
If Not IsNull(rs_shoukuan.Fields(i)) Then
MSHFlexGrid1.Text = rs_shoukuan.Fields(i)
Else
MSHFlexGrid1.Text = ""
End If
Next i
rs_shoukuan.MoveNext
Loop
End If
displayerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Public Sub setgrid1()
Dim i As Integer
On Error GoTo seterror
With MSHFlexGrid1
.ScrollBars = flexScrollBarBoth
.FixedCols = 1
.Rows = rs_shoukuan.RecordCount + 1
.Cols = 8
.SelectionMode = flexSelectionByRow
For i = 0 To .Rows - 1
.RowHeight(i) = 315
Next
For i = 0 To .Cols - 1
.ColWidth(i) = 1300
Next i
End With
Exit Sub
seterror:
MsgBox Err.Description
End Sub
Public Sub setgridhead()
On Error GoTo setheaderror
With MSHFlexGrid1
.Row = 0
.Col = 0
.Text = "收款单号"
.Col = 1
.Text = "合同号"
.Col = 2
.Text = "楼盘编号"
.Col = 3
.Text = "收款日期"
.Col = 4
.Text = "收款金额"
.Col = 5
.Text = "付款方式"
.Col = 6
.Text = "收款人"
.Col = 7
.Text = "交款人"
End With
Exit Sub
setheaderror:
MsgBox Err.Description
End Sub
Public Sub setgrid2()
Dim i As Integer
With MSHFlexGrid2
.ScrollBars = flexScrollBarBoth
.FixedCols = 1
.Rows = rs_yushou.RecordCount + 1
.Cols = 3
.SelectionMode = flexSelectionByRow
For i = 0 To .Rows - 1
.RowHeight(i) = 315
Next
For i = 0 To .Cols - 1
.ColWidth(i) = 1300
Next i
End With
With MSHFlexGrid2
.Row = 0
.Col = 0
.Text = "付款日期"
.Col = 1
.Text = "付款金额"
.Col = 2
.Text = "是否已付款"
End With
End Sub
Private Sub MSHFlexGrid1_Click()
On Error GoTo griderror
getrow = MSHFlexGrid1.Row
If MSHFlexGrid1.Rows = 1 Then
MsgBox "无相关纪录", vbOKOnly + vbExclamation, ""
Else
select_row = MSHFlexGrid1.TextMatrix(getrow, 1)
displaymingxi
End If
griderror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Public Sub displaymingxi()
Dim sql As String
Dim i As Integer
sql = "select * from 预计付款 where 预计付款.Add_pactid = " & Val(select_row)
rs_yushou.CursorLocation = adUseClient
rs_yushou.Open sql, conn, adOpenKeyset, adLockPessimistic
setgrid2
MSHFlexGrid2.Row = 0
If Not rs_yushou.EOF Then
rs_yushou.MoveFirst
Do While Not rs_yushou.EOF
MSHFlexGrid2.Row = MSHFlexGrid2.Row + 1
For i = 0 To 2
MSHFlexGrid2.Col = i
If Not IsNull(rs_yushou.Fields(i + 1)) Then
MSHFlexGrid2.Text = rs_yushou.Fields(i + 1)
Else
MSHFlexGrid2.Text = ""
End If
Next i
rs_yushou.MoveNext
Loop
End If
rs_yushou.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -