home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD242012201999.psc / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-12-20  |  4.2 KB  |  123 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "AutoComplete TextBox"
  5.    ClientHeight    =   1260
  6.    ClientLeft      =   45
  7.    ClientTop       =   360
  8.    ClientWidth     =   3915
  9.    Icon            =   "Form1.frx":0000
  10.    KeyPreview      =   -1  'True
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1260
  15.    ScaleWidth      =   3915
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.CommandButton Command1 
  18.       Caption         =   "&Close"
  19.       BeginProperty Font 
  20.          Name            =   "Arial"
  21.          Size            =   8.25
  22.          Charset         =   0
  23.          Weight          =   400
  24.          Underline       =   0   'False
  25.          Italic          =   0   'False
  26.          Strikethrough   =   0   'False
  27.       EndProperty
  28.       Height          =   255
  29.       Left            =   2400
  30.       TabIndex        =   2
  31.       Top             =   960
  32.       Width           =   1335
  33.    End
  34.    Begin VB.TextBox txtName 
  35.       BeginProperty Font 
  36.          Name            =   "Arial"
  37.          Size            =   8.25
  38.          Charset         =   0
  39.          Weight          =   400
  40.          Underline       =   0   'False
  41.          Italic          =   0   'False
  42.          Strikethrough   =   0   'False
  43.       EndProperty
  44.       Height          =   285
  45.       Left            =   120
  46.       TabIndex        =   1
  47.       Top             =   600
  48.       Width           =   3495
  49.    End
  50.    Begin VB.Label Label3 
  51.       Caption         =   "mautheman@yahoo.com"
  52.       ForeColor       =   &H000000C0&
  53.       Height          =   255
  54.       Left            =   120
  55.       TabIndex        =   4
  56.       Top             =   960
  57.       Width           =   2175
  58.    End
  59.    Begin VB.Label Label2 
  60.       Caption         =   "Type the name you're looking for :"
  61.       BeginProperty Font 
  62.          Name            =   "Arial"
  63.          Size            =   8.25
  64.          Charset         =   0
  65.          Weight          =   400
  66.          Underline       =   0   'False
  67.          Italic          =   0   'False
  68.          Strikethrough   =   0   'False
  69.       EndProperty
  70.       Height          =   255
  71.       Left            =   600
  72.       TabIndex        =   3
  73.       Top             =   360
  74.       Width           =   2535
  75.    End
  76.    Begin VB.Label Label1 
  77.       Caption         =   "Example of AutoComplete TextBox"
  78.       BeginProperty Font 
  79.          Name            =   "Arial"
  80.          Size            =   8.25
  81.          Charset         =   0
  82.          Weight          =   400
  83.          Underline       =   0   'False
  84.          Italic          =   0   'False
  85.          Strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   255
  88.       Left            =   600
  89.       TabIndex        =   0
  90.       Top             =   120
  91.       Width           =   2775
  92.    End
  93. Attribute VB_Name = "Form1"
  94. Attribute VB_GlobalNameSpace = False
  95. Attribute VB_Creatable = False
  96. Attribute VB_PredeclaredId = True
  97. Attribute VB_Exposed = False
  98. '**************************************************************
  99. 'This is an example of how to use the AutoCompleteTextBox
  100. 'just make sure the database "sampledatabase.mdb" and the
  101. 'program are in the same directory
  102. 'any problem with the program, e-mail me
  103. '                    mautheman@yahoo.com
  104. '**************************************************************
  105. Public db As Database 'declare the database
  106. Public ds As Recordset 'declare the table
  107. Private Sub Command1_Click()
  108. End Sub
  109. Private Sub Form_Load()
  110. On Error GoTo ErrLine:
  111. Set db = OpenDatabase(App.Path & "\sampledatabase.mdb") 'open the database
  112. Set ds = db.OpenRecordset("sampletable", dbOpenDynaset) 'open the table
  113. Exit Sub
  114. ErrLine:
  115. MsgBox "There was a problem while opening the database or table, it's impossible to open this program (check if the database 'sampledatabase' and the programa are in the same directory )", vbCritical, "Problems"
  116. End Sub
  117. Private Sub txtName_Change()
  118. AutoComplete txtName, db, "sampletable", "Author"
  119. End Sub
  120. Private Sub txtName_KeyDown(KeyCode As Integer, Shift As Integer)
  121. CheckIsDelOrBack (KeyCode)
  122. End Sub
  123.