frmFindSP.frm
上传用户:yexiandon
上传日期:2022-07-12
资源大小:895k
文件大小:4k
- VERSION 5.00
- Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
- Begin VB.Form frmFindSP
- BorderStyle = 3 'Fixed Dialog
- Caption = "配件查询选取"
- ClientHeight = 3675
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7680
- Icon = "frmFindSP.frx":0000
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3675
- ScaleWidth = 7680
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton CmdEXIT
- Cancel = -1 'True
- Caption = "退出"
- Height = 300
- Left = 6600
- TabIndex = 2
- Top = 3240
- Width = 855
- End
- Begin VB.CommandButton CmdSEL
- Caption = "选中"
- Height = 300
- Left = 5640
- TabIndex = 1
- Top = 3240
- Width = 855
- End
- Begin MSFlexGridLib.MSFlexGrid GD1
- Height = 3030
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 7455
- _ExtentX = 13150
- _ExtentY = 5345
- _Version = 393216
- Cols = 5
- FixedCols = 0
- AllowBigSelection= 0 'False
- FocusRect = 0
- SelectionMode = 1
- AllowUserResizing= 1
- FormatString = "配件名称|规格型号|ID|单位|数量"
- End
- End
- Attribute VB_Name = "frmFindSP"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '****************************************************************************
- '人人为我,我为人人
- '枕善居收藏整理
- '发布日期:2008/01/21
- '描 述:汽车维修管理系统SQL2000版
- '网 站:http://www.Mndsoft.com/ (VB6源码博客)
- '网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
- 'e-mail :Mndsoft@163.com
- 'e-mail :Mndsoft@126.com
- 'OICQ :88382850
- ' 如果您有新的好的代码别忘记给枕善居哦!
- '****************************************************************************
- Option Explicit
- Private OK As Boolean
- Public Function Rel(ByVal strSQL As String, ByRef objPJ As CpName) As Boolean
- LoadGD (strSQL)
- OK = False
- Me.Show vbModal
- If OK = False Then Exit Function
- If GD1.TextMatrix(GD1.Row, 2) = "" Then Exit Function
- objPJ.pName = GD1.TextMatrix(GD1.Row, 0)
- objPJ.pType = GD1.TextMatrix(GD1.Row, 1)
- objPJ.pid = Val(GD1.TextMatrix(GD1.Row, 2))
- objPJ.pUnit = GD1.TextMatrix(GD1.Row, 3)
- objPJ.pNum = Val(GD1.TextMatrix(GD1.Row, 4))
- Rel = True
- Unload Me
- End Function
- Private Sub cmdExit_Click()
- OK = False
- Me.Hide
- End Sub
- Private Sub CmdSEL_Click()
- OK = True
- Me.Hide
- End Sub
- Private Sub Form_Load()
- With GD1
- .Redraw = False
- .ColWidth(0) = 1600
- .ColWidth(1) = 1500
- .ColWidth(2) = 0
- .ColWidth(3) = 500
- .Redraw = True
- End With
- End Sub
- Private Sub GD1_DblClick()
- CmdSEL_Click
- End Sub
- Private Sub GD1_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then CmdSEL_Click
- End Sub
- Private Sub LoadGD(ByVal sSQL As String)
- Dim i, j, n As Integer
- Dim Rs As ADODB.Recordset
- Set Rs = g_Conn.Execute(sSQL)
- n = Rs.RecordCount
- If n > 0 Then
- GD1.Rows = n + 1
- For i = 1 To GD1.Rows - 1
- For j = 0 To GD1.Cols - 1
- GD1.TextMatrix(i, j) = ""
- Next
- Next
- For i = 1 To Rs.RecordCount
- GD1.TextMatrix(i, 0) = Rs(0)
- GD1.TextMatrix(i, 1) = Rs(1)
- GD1.TextMatrix(i, 2) = Rs(2)
- GD1.TextMatrix(i, 3) = Rs(3)
- GD1.TextMatrix(i, 4) = Rs(4)
- Rs.MoveNext
- Next
- End If
- Set Rs = Nothing
- End Sub