home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{BA7155BB-813E-11D1-B8F4-0080ADA85B53}#1.0#0"; "JSGridEX.ocx"
- Begin VB.Form frmList
- BorderStyle = 3 'Fixed Dialog
- Caption = "Form1"
- ClientHeight = 3075
- ClientLeft = 1365
- ClientTop = 2865
- ClientWidth = 6660
- Icon = "frmList.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 205
- ScaleMode = 3 'Pixel
- ScaleWidth = 444
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 5415
- TabIndex = 2
- Top = 735
- Width = 1200
- End
- Begin VB.CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 5415
- TabIndex = 1
- Top = 360
- Width = 1200
- End
- Begin JSGridEX.GridEX gexList
- Height = 2550
- Left = 75
- TabIndex = 0
- Top = 390
- Width = 5220
- _ExtentX = 9208
- _ExtentY = 4498
- MethodHoldFields= -1 'True
- ContScroll = -1 'True
- GroupByBoxInfoText= ""
- AllowEdit = 0 'False
- GroupByBoxVisible= 0 'False
- BackColor = -2147483624
- ForeColor = -2147483625
- ImageCount = 3
- ImagePicture1 = "frmList.frx":000C
- ImagePicture2 = "frmList.frx":011E
- ImagePicture3 = "frmList.frx":0438
- ColumnCount = 3
- CardCaption1 = -1 'True
- ColHeaderIcon1 = 1
- ColKey1 = "Icon"
- ColWidth1 = 330
- ColumnType1 = 1
- ColEditType1 = 0
- ColKey2 = "ID"
- ColWidth2 = 1200
- ColEditType2 = 0
- ColKey3 = "Name"
- ColWidth3 = 3390
- ColEditType3 = 0
- GridLines = 0 'False
- BackColorBkg = -2147483624
- ColumnHeaderHeight= 285
- End
- Begin VB.Label lblInfo
- AutoSize = -1 'True
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 195
- Left = 90
- TabIndex = 3
- Top = 90
- Width = 45
- End
- Attribute VB_Name = "frmList"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim m_OK As Boolean
- Public Function ChooseSupplier(ByVal dbName As String, ByVal SupplierID As String) As Variant
- Dim cols As JSGridEX.Columns
- Dim col As JSGridEX.Column
- Dim rsTemp As Recordset
- m_OK = False
- Set cols = gexList.Columns
- Set col = cols("Icon")
- col.DefaultIcon = 3
- Set col = cols("ID")
- col.Caption = "Supplier ID"
- col.DataField = "SupplierID"
- col.TextAlignment = jgexAlignRight
- col.SortType = jgexSortTypeNumeric
- Set col = cols("Name")
- col.Caption = "Supplier"
- col.DataField = "CompanyName"
- gexList.DatabaseName = dbName
- gexList.RecordSource = "Suppliers"
- gexList.RecordsetType = jgexRSDAOTable
- gexList.HoldFields
- gexList.Rebind
- gexList.SortKeys.Add 3, jgexSortAscending
- Set Me.Icon = gexList.GridImages(3).Picture
- Me.Caption = "Suppliers List"
- lblInfo = "Select a supplier from the list:"
- gexList.RefreshSort
- Set rsTemp = gexList.Recordset
- rsTemp.Index = "PrimaryKey"
- rsTemp.Seek "=", SupplierID
- If rsTemp.NoMatch Then
- gexList.Row = 0
- Else
- gexList.MoveToBookmark rsTemp.Bookmark
- End If
- Show 1
- If m_OK Then
- If gexList.Row <> 0 Then
- ChooseSupplier = gexList.Value(2)
- Else
- ChooseSupplier = ""
- End If
- Else
- ChooseSupplier = Null
- End If
- Unload Me
- End Function
- Public Function ChooseCustomer(ByVal dbName As String, ByVal CustomerID As String) As Variant
- Dim cols As JSGridEX.Columns
- Dim col As JSGridEX.Column
- Dim rsTemp As Recordset
- m_OK = False
- Set cols = gexList.Columns
- Set col = cols("Icon")
- col.DefaultIcon = 3
- Set col = cols("ID")
- col.Caption = "Customer ID"
- col.DataField = "CustomerID"
- Set col = cols("Name")
- col.Caption = "Customer"
- col.DataField = "CompanyName"
- gexList.DatabaseName = dbName
- gexList.RecordSource = "Customers"
- gexList.RecordsetType = jgexRSDAOTable
- gexList.HoldFields
- gexList.Rebind
- gexList.SortKeys.Add 3, jgexSortAscending
- Set Me.Icon = gexList.GridImages(2).Picture
- Me.Caption = "Customer List"
- lblInfo = "Select a customer from the list:"
- gexList.RefreshSort
- Set rsTemp = gexList.Recordset
- rsTemp.Index = "PrimaryKey"
- rsTemp.Seek "=", CustomerID
- If rsTemp.NoMatch Then
- gexList.Row = 0
- Else
- gexList.MoveToBookmark rsTemp.Bookmark
- End If
- Show 1
- If m_OK Then
- If gexList.Row <> 0 Then
- ChooseCustomer = gexList.Value(2)
- Else
- ChooseCustomer = ""
- End If
- Else
- ChooseCustomer = Null
- End If
- Unload Me
- End Function
- Private Sub cmdCancel_Click()
- Hide
- End Sub
- Private Sub cmdOK_Click()
- m_OK = True
- Hide
- End Sub
- Private Sub gexList_ColumnHeaderClick(Column As JSGridEX.Column)
- If Column.Index <> 1 Then
- If Column.SortOrder = jgexSortNone Then
- gexList.SortKeys.Clear
- gexList.SortKeys.Add Column.Index, jgexSortAscending
- Else
- If gexList.SortKeys(1).SortOrder = jgexSortAscending Then
- gexList.SortKeys(1).SortOrder = jgexSortDescending
- Else
- gexList.SortKeys(1).SortOrder = jgexSortAscending
- End If
- End If
- End If
- End Sub
- Private Sub gexList_DblClick()
- cmdOK_Click
- End Sub
-