home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / VISDATA / FIND.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-12  |  6.2 KB  |  211 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFindForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "
  5.    ClientHeight    =   2430
  6.    ClientLeft      =   1995
  7.    ClientTop       =   2595
  8.    ClientWidth     =   5445
  9.    HelpContextID   =   2016128
  10.    Icon            =   "FIND.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   2024.58
  16.    ScaleMode       =   0  'User
  17.    ScaleWidth      =   5358.743
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   1  'CenterOwner
  20.    Begin VB.OptionButton optFindType 
  21.       Caption         =   "
  22.       Height          =   255
  23.       Index           =   3
  24.       Left            =   3120
  25.       MaskColor       =   &H00000000&
  26.       TabIndex        =   9
  27.       Top             =   1440
  28.       Width           =   2055
  29.    End
  30.    Begin VB.OptionButton optFindType 
  31.       Caption         =   "
  32.       Height          =   255
  33.       Index           =   2
  34.       Left            =   3120
  35.       MaskColor       =   &H00000000&
  36.       TabIndex        =   8
  37.       Top             =   1200
  38.       Width           =   2055
  39.    End
  40.    Begin VB.OptionButton optFindType 
  41.       Caption         =   "
  42.       Height          =   255
  43.       Index           =   1
  44.       Left            =   3120
  45.       MaskColor       =   &H00000000&
  46.       TabIndex        =   7
  47.       Top             =   960
  48.       Width           =   2055
  49.    End
  50.    Begin VB.OptionButton optFindType 
  51.       Caption         =   "
  52.       Height          =   255
  53.       Index           =   0
  54.       Left            =   3120
  55.       MaskColor       =   &H00000000&
  56.       TabIndex        =   6
  57.       Top             =   720
  58.       Value           =   -1  'True
  59.       Width           =   2055
  60.    End
  61.    Begin VB.ListBox lstFields 
  62.       BackColor       =   &H00FFFFFF&
  63.       Height          =   1350
  64.       Left            =   240
  65.       TabIndex        =   1
  66.       Top             =   360
  67.       Width           =   1695
  68.    End
  69.    Begin VB.ListBox lstOperators 
  70.       BackColor       =   &H00FFFFFF&
  71.       Height          =   1350
  72.       ItemData        =   "FIND.frx":030A
  73.       Left            =   2040
  74.       List            =   "FIND.frx":0311
  75.       TabIndex        =   3
  76.       Top             =   360
  77.       Width           =   960
  78.    End
  79.    Begin VB.TextBox txtExpression 
  80.       BackColor       =   &H00FFFFFF&
  81.       Height          =   285
  82.       Left            =   3120
  83.       TabIndex        =   5
  84.       Top             =   360
  85.       Width           =   2055
  86.    End
  87.    Begin VB.CommandButton cmdOK 
  88.       Caption         =   "
  89. (&O)"
  90.       Default         =   -1  'True
  91.       Enabled         =   0   'False
  92.       Height          =   372
  93.       Left            =   600
  94.       MaskColor       =   &H00000000&
  95.       TabIndex        =   10
  96.       Top             =   1919
  97.       Width           =   1691
  98.    End
  99.    Begin VB.CommandButton cmdCancel 
  100.       Cancel          =   -1  'True
  101.       Caption         =   "
  102. (&C)"
  103.       Height          =   372
  104.       Left            =   2879
  105.       MaskColor       =   &H00000000&
  106.       TabIndex        =   11
  107.       Top             =   1919
  108.       Width           =   1691
  109.    End
  110.    Begin VB.Label lblLabels 
  111.       AutoSize        =   -1  'True
  112.       Caption         =   "
  113.       Height          =   195
  114.       Index           =   1
  115.       Left            =   2040
  116.       TabIndex        =   2
  117.       Top             =   120
  118.       Width           =   840
  119.    End
  120.    Begin VB.Label lblLabels 
  121.       AutoSize        =   -1  'True
  122.       Caption         =   "
  123.       Height          =   195
  124.       Index           =   0
  125.       Left            =   240
  126.       TabIndex        =   0
  127.       Top             =   120
  128.       Width           =   510
  129.    End
  130.    Begin VB.Label lblLabels 
  131.       AutoSize        =   -1  'True
  132.       Caption         =   "
  133.       Height          =   195
  134.       Index           =   2
  135.       Left            =   3120
  136.       TabIndex        =   4
  137.       Top             =   120
  138.       Width           =   1515
  139.    End
  140. Attribute VB_Name = "frmFindForm"
  141. Attribute VB_GlobalNameSpace = False
  142. Attribute VB_Creatable = False
  143. Attribute VB_PredeclaredId = True
  144. Attribute VB_Exposed = False
  145. Option Explicit
  146. '>>>>>>>>>>>>>>>>>>>>>>>>
  147. Const FORMCAPTION = "
  148. Const BUTTON1 = "
  149. (&O)"
  150. Const BUTTON2 = "
  151. (&C)"
  152. Const Label1 = "
  153. Const Label2 = "
  154. Const LABEL3 = "
  155. '>>>>>>>>>>>>>>>>>>>>>>>>
  156. Dim mbNotFound As Integer
  157. Private Sub cmdCancel_Click()
  158.   Hide
  159.  recordset/recagrid 
  160.   gbFindFailed = True
  161. End Sub
  162. Private Sub optFindType_Click(Index As Integer)
  163.   gnFindType = Index
  164. End Sub
  165. Private Sub txtExpression_Change()
  166.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  167. End Sub
  168. Private Sub lstFields_Click()
  169.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  170. End Sub
  171. Private Sub lstOperators_Click()
  172.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  173. End Sub
  174. Private Sub Form_Load()
  175.   Me.Caption = FORMCAPTION
  176.   cmdOK.Caption = BUTTON1
  177.   cmdCancel.Caption = BUTTON2
  178.   lblLabels(0).Caption = Label1
  179.   lblLabels(1).Caption = Label2
  180.   lblLabels(2).Caption = LABEL3
  181.   lstOperators.AddItem "="
  182.   lstOperators.AddItem "<>"
  183.   lstOperators.AddItem ">="
  184.   lstOperators.AddItem "<="
  185.   lstOperators.AddItem ">"
  186.   lstOperators.AddItem "<"
  187.   lstOperators.AddItem "Like"
  188.   lstOperators.ListIndex = 0
  189.   mbNotFound = False
  190. End Sub
  191. Private Sub cmdOK_Click()
  192.    On Error GoTo FindErr
  193.    Dim i As Integer
  194.    i = lstFields.ListIndex
  195.    mbNotFound = False
  196.    Screen.MousePointer = vbHourglass
  197.    gsFindField = lstFields.Text
  198.    gsFindExpr = txtExpression.Text
  199.    gsFindOp = lstOperators.Text
  200.    Hide
  201.    Screen.MousePointer = vbDefault
  202.    Exit Sub
  203. FindErr:
  204.    If Err <> gnEOF_ERR Then
  205.      ShowError
  206.    Else
  207.      mbNotFound = True
  208.      Resume Next
  209.    End If
  210. End Sub
  211.