home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / find1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  5.5 KB  |  193 lines

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