📄 popbranch.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form popBranch
BorderStyle = 1 'Fixed Single
Caption = "IMPULSE - SELECT AGENT"
ClientHeight = 5565
ClientLeft = 45
ClientTop = 330
ClientWidth = 4830
KeyPreview = -1 'True
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5565
ScaleWidth = 4830
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtSearch
Height = 285
Left = 90
TabIndex = 2
Top = 540
Width = 4605
End
Begin VB.CommandButton cmdDone
Caption = "&Done"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3870
TabIndex = 1
Top = 180
Width = 825
End
Begin VB.TextBox txtBranchId
Enabled = 0 'False
Height = 285
Left = 1935
TabIndex = 0
Top = 180
Width = 1545
End
Begin MSFlexGridLib.MSFlexGrid MSGrid
Height = 4560
Left = 90
TabIndex = 3
Top = 900
Width = 4650
_ExtentX = 8202
_ExtentY = 8043
_Version = 393216
SelectionMode = 1
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Agent ID"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 180
TabIndex = 4
Top = 225
Width = 825
End
End
Attribute VB_Name = "popBranch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDone_Click()
Me.Hide
End Sub
Private Sub Form_Activate()
txtSearch.SetFocus
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 27
txtBranchId = ""
Me.Hide
End Select
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 4
cmdDone_Click
End Select
End Sub
Private Sub Form_Load()
FillGrid ("")
End Sub
Private Sub MSGrid_Click()
If MSGrid.Rows > 1 Then
txtBranchId = Trim(MSGrid.TextMatrix(MSGrid.Row, 3))
End If
End Sub
Private Sub MSGrid_DblClick()
MSGrid_Click
cmdDone_Click
End Sub
Private Sub MSGrid_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 13
MSGrid_Click
cmdDone_Click
End Select
End Sub
Private Sub txtSearch_Change()
txtBranchId = txtSearch
Call FillGrid(txtSearch)
End Sub
Private Function FillGrid(pStr As String)
Dim rstSearch As ADODB.Recordset
Dim gString, i
Set rstSearch = New ADODB.Recordset
If Trim(pStr) = "" Then
gString = "select * from aBranchMaster order by r_Id"
Else
gString = "select * from aBranchMaster where r_Id like '%" & fnEscapeQuote(Trim(pStr)) & "%' or r_Name like '%" & fnEscapeQuote(Trim(pStr)) & "%' or r_Email like '%" & fnEscapeQuote(Trim(pStr)) & "%' order by r_Id"
End If
'MsgBox gString
Set rstSearch = CNimanager.Execute(gString)
MSGrid.Clear
With MSGrid
.Rows = 1
.Clear
.Cols = 4
.ColAlignment(0) = flexAlignCenterCenter
.ColWidth(0) = 500
.ColWidth(1) = 1500
.ColWidth(2) = 1500
.ColWidth(3) = 1000
.TextMatrix(0, 0) = "S No"
.TextMatrix(0, 1) = "Name"
.TextMatrix(0, 2) = "Email"
.TextMatrix(0, 3) = "Id"
If Not rstSearch.EOF Or Not rstSearch.BOF Then
Do While Not rstSearch.EOF
.Rows = .Rows + 1
i = .Rows - 1
.TextMatrix(i, 0) = i
.TextMatrix(i, 1) = rstSearch("r_Name")
.TextMatrix(i, 2) = rstSearch("r_Email")
.TextMatrix(i, 3) = rstSearch("r_Id")
i = i + 1
rstSearch.MoveNext
Loop
End If
End With
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -