home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap27 / frm527.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-28  |  2.2 KB  |  75 lines

  1. VERSION 4.00
  2. Begin VB.Form form4 
  3.    Caption         =   "Form3"
  4.    ClientHeight    =   3960
  5.    ClientLeft      =   1620
  6.    ClientTop       =   2370
  7.    ClientWidth     =   6690
  8.    Height          =   4365
  9.    Left            =   1560
  10.    LinkTopic       =   "Form5"
  11.    ScaleHeight     =   3960
  12.    ScaleWidth      =   6690
  13.    Top             =   2025
  14.    Width           =   6810
  15.    Begin VB.Data Data1 
  16.       Caption         =   "Data1"
  17.       Connect         =   "Access"
  18.       DatabaseName    =   ""
  19.       Exclusive       =   0   'False
  20.       Height          =   300
  21.       Left            =   1140
  22.       Options         =   0
  23.       ReadOnly        =   0   'False
  24.       RecordsetType   =   1  'Dynaset
  25.       RecordSource    =   ""
  26.       Top             =   3600
  27.       Width           =   1155
  28.    End
  29.    Begin VB.ComboBox comfield 
  30.       Height          =   315
  31.       Left            =   1560
  32.       TabIndex        =   1
  33.       Text            =   "Combo1"
  34.       Top             =   3120
  35.       Width           =   1215
  36.    End
  37.    Begin VB.Label lblfield 
  38.       Caption         =   "Order By"
  39.       Height          =   285
  40.       Left            =   130
  41.       TabIndex        =   2
  42.       Top             =   3130
  43.       Width           =   1215
  44.    End
  45.    Begin MSDBGrid.DBGrid DBGrid1 
  46.       Bindings        =   "frm527.frx":0000
  47.       Height          =   2895
  48.       Left            =   0
  49.       OleObjectBlob   =   "frm527.frx":000E
  50.       TabIndex        =   0
  51.       Top             =   60
  52.       Width           =   6675
  53.    End
  54. Attribute VB_Name = "form4"
  55. Attribute VB_Creatable = False
  56. Attribute VB_Exposed = False
  57. Option Explicit
  58. Private Sub comfield_Click()
  59.     If comfield.TEXT <> "Comments" Then
  60.         Data1.RecordSource = "select * From titles order by [" & comfield.TEXT & "]"
  61.         Data1.Refresh
  62.     End If
  63. End Sub
  64. Private Sub Form_Load()
  65. Dim filepath As String
  66. Dim x As Integer
  67. filepath = "\source\chp27"
  68. Data1.DatabaseName = filepath & "biblio.mdb"
  69. Data1.RecordSource = "select * From titles order by pubid ,[year published]"
  70. Data1.Refresh
  71.     For x = 0 To Data1.Recordset.Fields.Count - 1
  72.         comfield.AddItem Data1.Recordset.Fields(x).Name
  73.     Next x
  74. End Sub
  75.