📄 frmqueryall.frm
字号:
VERSION 5.00
Begin VB.Form frmQueryAll
BackColor = &H80000007&
Caption = "Form1"
ClientHeight = 6075
ClientLeft = 60
ClientTop = 345
ClientWidth = 7710
LinkTopic = "Form1"
ScaleHeight = 6075
ScaleWidth = 7710
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox lst
Height = 4380
Left = 120
TabIndex = 15
Top = 360
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 0
Left = 3960
TabIndex = 14
Top = 360
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 1
Left = 3960
TabIndex = 13
Top = 840
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 2
Left = 3960
TabIndex = 12
Top = 1320
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 3
Left = 3960
TabIndex = 11
Top = 1800
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 4
Left = 3960
TabIndex = 10
Top = 2280
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 5
Left = 3960
TabIndex = 9
Top = 2760
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 6
Left = 3960
TabIndex = 8
Top = 3240
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 8
Left = 3960
TabIndex = 7
Top = 3720
Width = 3615
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 9
Left = 3960
TabIndex = 6
Top = 4200
Width = 3615
End
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "关 闭"
Height = 345
Left = 120
TabIndex = 5
Top = 5520
Width = 975
End
Begin VB.CommandButton cmdFind
Caption = "按用户账号查找"
Enabled = 0 'False
Height = 345
Left = 120
TabIndex = 4
Top = 5040
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 300
Index = 10
Left = 3960
TabIndex = 3
Top = 4680
Width = 3615
End
Begin VB.CommandButton cmdSID
Caption = "按身份证号查找"
Height = 345
Left = 4920
TabIndex = 2
Top = 5520
Width = 1575
End
Begin VB.TextBox txt
Height = 300
Index = 11
Left = 1560
TabIndex = 1
Top = 5520
Width = 3135
End
Begin VB.CommandButton cmdNextSID
Caption = "下一位"
Height = 345
Left = 6600
TabIndex = 0
Top = 5520
Width = 975
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户姓名:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 0
Left = 3000
TabIndex = 25
Top = 480
Width = 900
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "代办人姓名:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 2880
TabIndex = 24
Top = 960
Width = 1080
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户身份证号:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 2
Left = 2760
TabIndex = 23
Top = 1440
Width = 1260
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "代办人身份证号:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 3
Left = 2520
TabIndex = 22
Top = 1920
Width = 1440
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户住址:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 3000
TabIndex = 21
Top = 2400
Width = 900
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户电话:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 5
Left = 3000
TabIndex = 20
Top = 2880
Width = 900
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "代办人电话:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 6
Left = 2880
TabIndex = 19
Top = 3360
Width = 1080
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "存款方式:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 8
Left = 3000
TabIndex = 18
Top = 3840
Width = 900
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "银行手续员:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 9
Left = 2880
TabIndex = 17
Top = 4320
Width = 1080
End
Begin VB.Label lblFQA
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "开户日期:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 10
Left = 3000
TabIndex = 16
Top = 4800
Width = 900
End
End
Attribute VB_Name = "frmQueryAll"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Dim userID As String
Dim findID As String
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_FINDSTRINGEXACT = &H1A2
Dim rstFind As New Recordset
Private Sub cmdClose_Click()
Unload Me
End Sub
'响应 "查找" 按钮
Private Sub cmdFind_Click()
findID = InputBox("请输入你要查找的ID")
For i = 1 To 2
Dim ll_Rtn As Long, ls_FindString As String
ls_FindString = userID & Chr(0)
ll_Rtn = SendMessage(lst.hwnd, LB_FINDSTRINGEXACT, -1, ByVal ls_FindString)
If ll_Rtn <> -1 Then
lst.selected(ll_Rtn) = True
userID = findID
Else
MsgBox "帐户未找到!"
End If
Next i
End Sub
'响应 "查看操作记录" 按钮
Private Sub cmdLookWork_Click()
On Error Resume Next
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
rst.Open "select wdate from " & userID, con, adOpenDynamic, adLockOptimistic
rst.MoveFirst
Do While Not rst.EOF
frmWorkQuery.lst.AddItem (Mid(rst!Wdate, 1, 4) & "年" & Mid(rst!Wdate, 5, 2) & "月" & Mid(rst!Wdate, 7, 2) & "日 " & Mid(rst!Wdate, 9, 2) & "时" & Mid(rst!Wdate, 11, 2) & "分" & Mid(rst!Wdate, 13, 2) & "秒")
rst.MoveNext
Loop
rst.Close
con.Close
frmWorkQuery.userID = userID
frmWorkQuery.Show
End Sub
Private Sub cmdNextSID_Click()
Dim errMove As Boolean
errMove = True
On Error GoTo err2
rstFind.MoveNext
Call selected(rstFind!id)
errMove = False
err2:
If errMove Then
MsgBox "未找到!"
Exit Sub
End If
End Sub
Private Sub cmdSID_Click()
On Error GoTo err3
rstFind.Close
err3:
Dim lookID As String
Dim errFind As Boolean
If txt(11).Text = "" Then
MsgBox "请在右边的文本框中输入你要查找的身份证号"
Exit Sub
End If
lookID = txt(11).Text
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
errFind = True
On Error GoTo err1
rstFind.Open "select * from CConsumers where userStationID='" & lookID & "'", con, adOpenDynamic, adLockOptimistic
lookID = rstFind!id
errFind = False
err1:
If errFind Then
MsgBox "此身份证号未找到!"
Exit Sub
End If
Call selected(lookID)
End Sub
'响应列表
Private Sub lst_Click()
userID = lst.Text
Set rst = New Recordset
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
rst.Open "select * from CConsumers where id='" & lst.Text & "'", con, adOpenDynamic, adLockOptimistic
txt(0).Text = rst!userName
txt(1).Text = rst!deputizeName
txt(2).Text = rst!userStationID
txt(3).Text = rst!deputizeStationID
txt(4).Text = rst!userAddress
txt(5).Text = rst!userPhone
txt(6).Text = rst!deputizePhone
txt(8).Text = "活期"
txt(9).Text = rst!procedurePerson
txt(10).Text = Mid(userID, 2, 4) & "年" & Mid(userID, 6, 2) & "月" & Mid(userID, 8, 2) & "日 " & Mid(userID, 10, 2) & "时" & Mid(userID, 12, 2) & "分" & Mid(userID, 14, 2) & "秒"
rst.Close
cmdFind.Enabled = True
con.Close
End Sub
Private Function selected(lookID As String) As Boolean
selected = False
For i = 1 To 2
Dim ll_Rtn As Long, ls_FindString As String
ls_FindString = lookID & Chr(0)
ll_Rtn = SendMessage(lst().hwnd, LB_FINDSTRINGEXACT, -1, ByVal ls_FindString)
If ll_Rtn <> -1 Then
lst().selected(ll_Rtn) = True
selected = True
End If
Next i
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -