📄 popchallan.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form popChallan
Caption = "iManager- Challan"
ClientHeight = 5325
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 5325
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtSearch
Height = 285
Left = 0
TabIndex = 2
Top = 360
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 = 3780
TabIndex = 1
Top = 0
Width = 825
End
Begin VB.TextBox txtBookID
Enabled = 0 'False
Height = 285
Left = 1575
TabIndex = 0
Top = 0
Width = 1455
End
Begin MSFlexGridLib.MSFlexGrid MSGrid
Height = 4560
Left = 0
TabIndex = 3
Top = 720
Width = 4650
_ExtentX = 8202
_ExtentY = 8043
_Version = 393216
FixedCols = 0
SelectionMode = 1
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Book 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 = 90
TabIndex = 4
Top = 45
Width = 705
End
End
Attribute VB_Name = "popChallan"
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
txtBookID = Trim(MSGrid.TextMatrix(MSGrid.Row, 0))
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 distinct challan_no,inv_date, party_name from challan order by challan_no"
Else
gString = "select distinct challan_no,inv_date, party_name from challan where challan_no like '%" & fnEscapeQuote(Trim(pStr)) & "%' or party_name like '%" & fnEscapeQuote(Trim(pStr)) & "%' order by challan_no"
End If
'MsgBox gString
Set rstSearch = CNimanager.Execute(gString)
MSGrid.Clear
With MSGrid
.Rows = 1
.Clear
.Cols = 3
'.ColAlignment(0) = flexAlignCenterCenter
.ColWidth(0) = 1500
.ColWidth(1) = 1500
.ColWidth(2) = 1500
.TextMatrix(0, 0) = "Challan No."
.TextMatrix(0, 1) = "Date"
.TextMatrix(0, 2) = "Party Name"
If Not rstSearch.EOF Or Not rstSearch.BOF Then
Do While Not rstSearch.EOF
.Rows = .Rows + 1
i = .Rows - 1
.TextMatrix(i, 0) = rstSearch("challan_no")
.TextMatrix(i, 1) = rstSearch(1)
.TextMatrix(i, 2) = rstSearch(2)
i = i + 1
rstSearch.MoveNext
Loop
End If
End With
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -