home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk3 / phone.fr_ / phone.bin
Text File  |  1993-04-28  |  22KB  |  823 lines

  1. VERSION 2.00
  2. Begin Form Phone 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Phone List"
  6.    ClientHeight    =   4410
  7.    ClientLeft      =   675
  8.    ClientTop       =   1005
  9.    ClientWidth     =   8205
  10.    Height          =   4815
  11.    Left            =   615
  12.    LinkTopic       =   "Phone"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   4410
  15.    ScaleWidth      =   8205
  16.    Top             =   660
  17.    Width           =   8325
  18.    Begin CommandButton cUpdate 
  19.       Caption         =   "&Update"
  20.       Height          =   465
  21.       Left            =   3075
  22.       TabIndex        =   10
  23.       Top             =   3900
  24.       Width           =   2190
  25.    End
  26.    Begin CommandButton cDelete 
  27.       Caption         =   "&Delete"
  28.       Height          =   465
  29.       Left            =   5925
  30.       TabIndex        =   11
  31.       Top             =   3900
  32.       Width           =   1965
  33.    End
  34.    Begin CommandButton cNew 
  35.       Caption         =   "&New"
  36.       Height          =   465
  37.       Left            =   375
  38.       TabIndex        =   9
  39.       Top             =   3900
  40.       Width           =   2040
  41.    End
  42.    Begin PictureBox Picture1 
  43.       BackColor       =   &H00C0C0C0&
  44.       BorderStyle     =   0  'None
  45.       Height          =   2790
  46.       Left            =   2250
  47.       ScaleHeight     =   2790
  48.       ScaleWidth      =   5715
  49.       TabIndex        =   17
  50.       Top             =   600
  51.       Width           =   5715
  52.       Begin TextBox tPost 
  53.          BackColor       =   &H00C0C0C0&
  54.          DataSource      =   "Data1"
  55.          Height          =   285
  56.          Index           =   0
  57.          Left            =   4425
  58.          TabIndex        =   7
  59.          Text            =   "tPost"
  60.          Top             =   1800
  61.          Width           =   1140
  62.       End
  63.       Begin TextBox tCountry 
  64.          BackColor       =   &H00C0C0C0&
  65.          DataSource      =   "Data1"
  66.          Height          =   315
  67.          Index           =   0
  68.          Left            =   1125
  69.          TabIndex        =   6
  70.          Text            =   "tCountry"
  71.          Top             =   1800
  72.          Width           =   1965
  73.       End
  74.       Begin TextBox tCity 
  75.          BackColor       =   &H00C0C0C0&
  76.          DataSource      =   "Data1"
  77.          Height          =   285
  78.          Index           =   0
  79.          Left            =   1125
  80.          TabIndex        =   4
  81.          Text            =   "tCity"
  82.          Top             =   1350
  83.          Width           =   1515
  84.       End
  85.       Begin TextBox tFName 
  86.          BackColor       =   &H00C0C0C0&
  87.          DataField       =   "FirstName"
  88.          DataSource      =   "Data1"
  89.          Height          =   285
  90.          Left            =   4050
  91.          TabIndex        =   2
  92.          Text            =   "tFName"
  93.          Top             =   75
  94.          Width           =   1515
  95.       End
  96.       Begin TextBox tRegion 
  97.          BackColor       =   &H00C0C0C0&
  98.          DataSource      =   "Data1"
  99.          Height          =   285
  100.          Index           =   0
  101.          Left            =   4425
  102.          TabIndex        =   5
  103.          Text            =   "tRegion"
  104.          Top             =   1335
  105.          Width           =   1140
  106.       End
  107.       Begin TextBox tAddress 
  108.          BackColor       =   &H00C0C0C0&
  109.          DataSource      =   "Data1"
  110.          Height          =   585
  111.          Index           =   0
  112.          Left            =   1110
  113.          MultiLine       =   -1  'True
  114.          TabIndex        =   3
  115.          Text            =   "tAddress"
  116.          Top             =   555
  117.          Width           =   4455
  118.       End
  119.       Begin TextBox tPhone 
  120.          BackColor       =   &H00C0C0C0&
  121.          DataSource      =   "Data1"
  122.          Height          =   285
  123.          Index           =   0
  124.          Left            =   1125
  125.          TabIndex        =   8
  126.          Text            =   "tPhone"
  127.          Top             =   2400
  128.          Width           =   1665
  129.       End
  130.       Begin TextBox tLName 
  131.          BackColor       =   &H00C0C0C0&
  132.          DataField       =   "LastName"
  133.          DataSource      =   "Data1"
  134.          Height          =   285
  135.          Left            =   1125
  136.          TabIndex        =   1
  137.          Text            =   "tLName"
  138.          Top             =   75
  139.          Width           =   1605
  140.       End
  141.       Begin Label Label11 
  142.          BackColor       =   &H00C0C0C0&
  143.          Caption         =   "Postal Code:"
  144.          Height          =   240
  145.          Left            =   3225
  146.          TabIndex        =   25
  147.          Top             =   1800
  148.          Width           =   1140
  149.       End
  150.       Begin Label Label10 
  151.          BackColor       =   &H00C0C0C0&
  152.          Caption         =   "Country:"
  153.          Height          =   240
  154.          Left            =   225
  155.          TabIndex        =   24
  156.          Top             =   1800
  157.          Width           =   690
  158.       End
  159.       Begin Label Label9 
  160.          BackColor       =   &H00C0C0C0&
  161.          Caption         =   "City:"
  162.          Height          =   240
  163.          Left            =   525
  164.          TabIndex        =   23
  165.          Top             =   1350
  166.          Width           =   390
  167.       End
  168.       Begin Label Label8 
  169.          BackColor       =   &H00C0C0C0&
  170.          Caption         =   "First Name:"
  171.          Height          =   255
  172.          Left            =   3000
  173.          TabIndex        =   22
  174.          Top             =   75
  175.          Width           =   975
  176.       End
  177.       Begin Label Label7 
  178.          BackColor       =   &H00C0C0C0&
  179.          Caption         =   "Region:"
  180.          Height          =   255
  181.          Left            =   3600
  182.          TabIndex        =   21
  183.          Top             =   1335
  184.          Width           =   660
  185.       End
  186.       Begin Label Label6 
  187.          BackColor       =   &H00C0C0C0&
  188.          Caption         =   "Address:"
  189.          Height          =   255
  190.          Left            =   225
  191.          TabIndex        =   20
  192.          Top             =   555
  193.          Width           =   735
  194.       End
  195.       Begin Label Label5 
  196.          BackColor       =   &H00C0C0C0&
  197.          Caption         =   "Phone:"
  198.          Height          =   255
  199.          Left            =   375
  200.          TabIndex        =   19
  201.          Top             =   2400
  202.          Width           =   615
  203.       End
  204.       Begin Label Label4 
  205.          BackColor       =   &H00C0C0C0&
  206.          Caption         =   "Last Name:"
  207.          Height          =   255
  208.          Left            =   0
  209.          TabIndex        =   18
  210.          Top             =   120
  211.          Width           =   975
  212.       End
  213.    End
  214.    Begin PictureBox Picture2 
  215.       BackColor       =   &H00C0C0C0&
  216.       BorderStyle     =   0  'None
  217.       Height          =   465
  218.       Left            =   2175
  219.       Picture         =   PHONE.FRX:0000
  220.       ScaleHeight     =   465
  221.       ScaleWidth      =   4740
  222.       TabIndex        =   13
  223.       Top             =   75
  224.       Width           =   4740
  225.       Begin Label Label1 
  226.          Alignment       =   2  'Center
  227.          BackStyle       =   0  'Transparent
  228.          Caption         =   "Work"
  229.          Height          =   240
  230.          Left            =   75
  231.          TabIndex        =   16
  232.          Top             =   150
  233.          Width           =   840
  234.       End
  235.       Begin Label Label2 
  236.          Alignment       =   2  'Center
  237.          BackStyle       =   0  'Transparent
  238.          Caption         =   "Home"
  239.          Height          =   240
  240.          Left            =   1050
  241.          TabIndex        =   15
  242.          Top             =   150
  243.          Width           =   765
  244.       End
  245.       Begin Label Label3 
  246.          Alignment       =   2  'Center
  247.          BackStyle       =   0  'Transparent
  248.          Caption         =   "Notes"
  249.          Height          =   240
  250.          Left            =   1950
  251.          TabIndex        =   14
  252.          Top             =   150
  253.          Width           =   840
  254.       End
  255.    End
  256.    Begin Outline Outline1 
  257.       BackColor       =   &H00C0C0C0&
  258.       Height          =   3765
  259.       Left            =   75
  260.       PictureClosed   =   PHONE.FRX:2C3C
  261.       PictureLeaf     =   PHONE.FRX:2EB6
  262.       PictureMinus    =   PHONE.FRX:3130
  263.       PictureOpen     =   PHONE.FRX:33AA
  264.       PicturePlus     =   PHONE.FRX:3624
  265.       Style           =   2  'Plus/Minus and Text
  266.       TabIndex        =   0
  267.       Top             =   75
  268.       Width           =   2040
  269.    End
  270.    Begin TextBox tNotes 
  271.       BackColor       =   &H00C0C0C0&
  272.       BorderStyle     =   0  'None
  273.       DataField       =   "Notes"
  274.       DataSource      =   "Data1"
  275.       FontBold        =   0   'False
  276.       FontItalic      =   0   'False
  277.       FontName        =   "MS Sans Serif"
  278.       FontSize        =   8.25
  279.       FontStrikethru  =   0   'False
  280.       FontUnderline   =   0   'False
  281.       Height          =   2865
  282.       Left            =   2250
  283.       MultiLine       =   -1  'True
  284.       TabIndex        =   12
  285.       Text            =   "tNotes"
  286.       Top             =   600
  287.       Width           =   5715
  288.    End
  289.    Begin Data Data1 
  290.       BackColor       =   &H00C0C0C0&
  291.       Caption         =   "Data1"
  292.       Connect         =   ""
  293.       DatabaseName    =   ""
  294.       Exclusive       =   0   'False
  295.       Height          =   315
  296.       Left            =   2175
  297.       Options         =   0
  298.       ReadOnly        =   0   'False
  299.       RecordSource    =   ""
  300.       Top             =   3525
  301.       Width           =   5940
  302.    End
  303.    Begin Image pTab1 
  304.       Height          =   480
  305.       Left            =   300
  306.       Picture         =   PHONE.FRX:389E
  307.       Top             =   5175
  308.       Width           =   4800
  309.    End
  310.    Begin Image pTab3 
  311.       Height          =   480
  312.       Left            =   300
  313.       Picture         =   PHONE.FRX:64DA
  314.       Top             =   6375
  315.       Width           =   4800
  316.    End
  317.    Begin Image pTab2 
  318.       Height          =   480
  319.       Left            =   300
  320.       Picture         =   PHONE.FRX:9116
  321.       Top             =   5775
  322.       Width           =   4800
  323.    End
  324.    Begin Line Line3 
  325.       X1              =   8100
  326.       X2              =   8100
  327.       Y1              =   3525
  328.       Y2              =   525
  329.    End
  330.    Begin Line Line2 
  331.       X1              =   8100
  332.       X2              =   6900
  333.       Y1              =   525
  334.       Y2              =   525
  335.    End
  336.    Begin Line Line1 
  337.       X1              =   2175
  338.       X2              =   2175
  339.       Y1              =   3525
  340.       Y2              =   525
  341.    End
  342. End
  343. Dim DBName As String
  344. Dim gLIBDB As Database
  345. Dim gDS As DynaSet
  346. Dim gCode As String
  347. Dim iCurrentRecord As Integer
  348. Dim fAll As Integer
  349. Dim CurrRec As Integer
  350. Dim fStartUp As Integer
  351. Dim iEditMode As Integer
  352.  
  353. Const EM_NOTHING = 0
  354. Const EM_EDIT = 1
  355. Const EM_ADDNEW = 2
  356.  
  357. Const YES = 6
  358. Const MSGBOX_TYPE = 4 + 48
  359.  
  360. Sub cDelete_Click ()
  361.   If Outline1.Indent(Outline1.ListIndex) = 2 Then   'Expanded name.
  362.     Outline1.RemoveItem Outline1.ListIndex
  363.   Else
  364.     Outline1.Expand(Outline1.ListIndex) = True
  365.     For i = Outline1.ListIndex To Outline1.ListCount - 1
  366.       If Outline1.List(i) = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName Then
  367.         Outline1.RemoveItem i
  368.         Exit For
  369.       End If
  370.     Next i
  371.   End If
  372.   
  373.   Data1.Recordset.Delete
  374.   Data1.Recordset.MoveNext
  375.   If Data1.Recordset.EOF Then Data1.Recordset.MovePrevious
  376.   Outline1.SetFocus
  377.  
  378. End Sub
  379.  
  380. Sub closedb ()
  381.   On Error Resume Next
  382.   gLIBDB.Close
  383. End Sub
  384.  
  385. Sub cNew_Click ()
  386.   On Error GoTo cNewErr
  387.  
  388.   CurrRec = Data1.Recordset!ID
  389.   Data1.Recordset.AddNew
  390.   Data1.Caption = "New Record"
  391.   Data1.Enabled = False
  392.   cNew.Enabled = False
  393.   cDelete.Enabled = False
  394.   cUpdate.Enabled = True
  395.   
  396.   tLName.SetFocus
  397.   
  398.   GoTo cNewEnd
  399.  
  400. cNewErr:
  401.   If Err = 3021 Then Resume Next
  402.   MsgBox Error$
  403.   Resume cNewEnd
  404.  
  405. cNewEnd:
  406.   
  407.  
  408. End Sub
  409.  
  410. Sub cUpdate_Click ()
  411.   If tLName <> "" And tFName <> "" Then
  412.     If Data1.EditMode = EM_ADDNEW Then
  413.       Data1.Recordset.Update
  414.       If Data1.EditMode = 0 Then    'Did record get written?
  415.         Data1.Recordset.MoveLast
  416.         CurrRec = Data1.Recordset!ID
  417.         Data1.Refresh
  418.         FillList
  419.         ProcessOutline
  420.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  421.       Else
  422.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  423.       End If
  424.     Else
  425.       Data1.Recordset.Update
  426.       If Data1.EditMode = 0 Then
  427.         CurrRec = Data1.Recordset!ID
  428.         Data1.Refresh
  429.         FillList
  430.         ProcessOutline
  431.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  432.       Else
  433.         Data1.UpdateControls
  434.       End If
  435.     End If
  436.     Data1.Enabled = True
  437.     cNew.Enabled = True
  438.     cDelete.Enabled = True
  439.     cUpdate.Enabled = False
  440.     Outline1.SetFocus
  441.  
  442.   Else
  443.     MsgBox "First and last name must have a value"
  444.   End If
  445. End Sub
  446.  
  447. Sub Data1_RePosition ()
  448.   gCode = tNotes.Text
  449.   
  450.   If Not Data1.Recordset.EOF Then
  451.     'Set the Data Control's caption:
  452.     If Not IsNull(Data1.Recordset!LastName) And Not IsNull(Data1.Recordset!FirstName) Then
  453.       Data1.Caption = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName
  454.     Else
  455.       Data1.Caption = ""
  456.     End If
  457.     
  458.     'Set Outline Control's selection to match current record:
  459.     For i% = 0 To Outline1.ListCount - 1
  460.       If Outline1.List(i%) = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName Then
  461.         Outline1.ListIndex = i%
  462.         If Not Outline1.IsItemVisible(Outline1.ListIndex) Then
  463.           'Set focus to first level item:
  464.           stChar = Left(Outline1.FullPath(Outline1.ListIndex), 1)
  465.           Do While stChar <> Outline1.List(Outline1.ListIndex)
  466.             Outline1.ListIndex = Outline1.ListIndex - 1
  467.           Loop
  468.         End If
  469.         Exit For
  470.       End If
  471.     Next i%
  472.   Else
  473.     Data1.Caption = "No records found!"
  474.   End If
  475. End Sub
  476.  
  477. Sub Data1_Validate (Action As Integer, Save As Integer)
  478.  
  479.   Select Case Action
  480.     Case 1          'First
  481.  
  482.     Case 2          'Previous
  483.  
  484.     Case 3          'Next
  485.  
  486.     Case 4          'Last
  487.  
  488.     Case 5          'AddNew
  489.  
  490.     Case 6          'Update
  491.       If Save = True Then
  492.         If MsgBox("Commit Changes?", MSGBOX_TYPE) <> YES Then Action = 0: Save = False
  493.       End If
  494.  
  495.     Case 7          'Delete
  496.         
  497.     Case 8
  498.       Save = False
  499.  
  500.     Case 9          'BookMark
  501.  
  502.     Case 10          'Close
  503.       If Save = True Then
  504.         If MsgBox("Commit Changes before Closing?", MSGBOX_TYPE) <> YES Then Save = False
  505.       End If
  506.  
  507.   End Select
  508.  
  509. End Sub
  510.  
  511. Sub FillList ()
  512.   On Error GoTo FillPhoneErr
  513.   
  514.   Set gDS = Data1.Recordset.Clone()
  515.   
  516.   Outline1.Clear
  517.   'Fill top level A-Z
  518.   For i = 0 To 25
  519.       Outline1.AddItem Chr$(65 + i)
  520.       Outline1.Indent(Outline1.ListCount - 1) = 1
  521.  
  522.       'Add Names
  523.       Do While Not gDS.EOF
  524.             If UCase(Left(gDS!LastName, 1)) = Chr$(65 + i) Then
  525.               Outline1.AddItem gDS!LastName + ", " + gDS!FirstName
  526.               Outline1.Indent(Outline1.ListCount - 1) = 2
  527.               gDS.MoveNext
  528.             Else
  529.               Exit Do
  530.             End If
  531.       Loop
  532.   Next i
  533.  
  534. EndOfData:
  535.   Exit Sub
  536.  
  537. FillPhoneErr:
  538.   MsgBox Error(Err)
  539.   Resume Next
  540.   Exit Sub
  541.   
  542.  
  543. End Sub
  544.  
  545. Sub Form_Load ()
  546.   DBName = App.Path + "\phone.mdb"
  547.   fStartUp = True
  548.   Data1.DatabaseName = DBName
  549.   X% = OpenDB(DBName)
  550.   
  551.   Load tPhone(1)
  552.   Load tAddress(1)
  553.   Load tCity(1)
  554.   Load tRegion(1)
  555.   Load tCountry(1)
  556.   Load tPost(1)
  557.   
  558.   cUpdate.Enabled = False
  559.   RefreshForm
  560.  
  561. End Sub
  562.  
  563. Sub Label1_Click ()
  564.   Picture2.Picture = pTab1.Picture
  565.   Picture1.Visible = True
  566.   
  567.   tPhone(0).Visible = True
  568.   tAddress(0).Visible = True
  569.   tCity(0).Visible = True
  570.   tRegion(0).Visible = True
  571.   tCountry(0).Visible = True
  572.   tPost(0).Visible = True
  573.   
  574.   tPhone(1).Visible = False
  575.   tAddress(1).Visible = False
  576.   tCity(1).Visible = False
  577.   tRegion(1).Visible = False
  578.   tCountry(1).Visible = False
  579.   tPost(1).Visible = False
  580.   
  581.   tNotes.Visible = False
  582. End Sub
  583.  
  584. Sub Label2_Click ()
  585.   Picture2.Picture = pTab2.Picture
  586.   Picture1.Visible = True
  587.   
  588.   tPhone(1).Visible = True
  589.   tAddress(1).Visible = True
  590.   tCity(1).Visible = True
  591.   tRegion(1).Visible = True
  592.   tCountry(1).Visible = True
  593.   tPost(1).Visible = True
  594.  
  595.   tPhone(0).Visible = False
  596.   tAddress(0).Visible = False
  597.   tCity(0).Visible = False
  598.   tRegion(0).Visible = False
  599.   tCountry(0).Visible = False
  600.   tPost(0).Visible = False
  601.  
  602.   tNotes.Visible = False
  603. End Sub
  604.  
  605. Sub Label3_Click ()
  606.   Picture2.Picture = pTab3.Picture
  607.   
  608.   Picture1.Visible = False
  609.   tNotes.Visible = True
  610.   
  611. End Sub
  612.  
  613. Function OpenDB (DBName As String) As Integer
  614.   Dim Connect As String
  615.  
  616.   On Error GoTo OpenDBErr
  617.  
  618.   Set gLIBDB = OpenDatabase(DBName)
  619.  
  620.   'success
  621.   OpenDB = True
  622.   GoTo OpenDBEnd
  623.  
  624. OpenDBErr:
  625.   OpenDB = False
  626.   Resume OpenDBEnd
  627.  
  628. OpenDBEnd:
  629.       
  630. End Function
  631.  
  632. Sub Outline1_Click ()
  633.   Dim stLName As String
  634.   Dim stFName As String
  635.   
  636.   If Outline1.Indent(Outline1.ListIndex) = 2 Then
  637.     stTmp$ = Outline1.List(Outline1.ListIndex)
  638.     stLName = stGetToken$(stTmp$, ",")
  639.     stFName = Right(stTmp$, Len(stTmp$) - 1)
  640.   
  641.     Data1.Recordset.FindFirst "LastName='" + stLName + "' and FirstNAME='" + stFName + "'"
  642.   End If
  643.  
  644. End Sub
  645.  
  646. Sub Outline1_Collapse (i As Integer)
  647.   Outline1.ListIndex = i
  648. End Sub
  649.  
  650. Sub Outline1_DblClick ()
  651.   If Outline1.Expand(Outline1.ListIndex) Then
  652.     Outline1.Expand(Outline1.ListIndex) = False
  653.   Else
  654.     Outline1.Expand(Outline1.ListIndex) = True
  655.   End If
  656. End Sub
  657.  
  658. Sub Outline1_Expand (i As Integer)
  659.   Outline1.ListIndex = i
  660. End Sub
  661.  
  662. Sub Outline1_KeyPress (KeyAscii As Integer)
  663.   If KeyAscii = 13 Then
  664.     Outline1_DblClick
  665.   End If
  666. End Sub
  667.  
  668. Sub ProcessOutline ()
  669.   For i% = 0 To Outline1.ListCount - 1
  670.     If Outline1.HasSubItems(i%) Then
  671.       Outline1.Expand(i%) = False
  672.     End If
  673.   Next i%
  674. End Sub
  675.  
  676. Sub RefreshForm ()
  677.   Data1.RecordSource = "select * from PhoneList order by LastName,FirstName"
  678.   Data1.Refresh
  679.   
  680.   'Set DataField properties for control array
  681.   tPhone(0).DataField = "WorkPhone"
  682.   tAddress(0).DataField = "WorkAddress"
  683.   tCity(0).DataField = "WorkCity"
  684.   tRegion(0).DataField = "WorkRegion"
  685.   tCountry(0).DataField = "WorkCountry"
  686.   tPost(0).DataField = "WorkPostalCode"
  687.   
  688.   tPhone(1).DataField = "HomePhone"
  689.   tAddress(1).DataField = "HomeAddress"
  690.   tCity(1).DataField = "HomeCity"
  691.   tRegion(1).DataField = "HomeRegion"
  692.   tCountry(1).DataField = "HomeCountry"
  693.   tPost(1).DataField = "HomePostalCode"
  694.   
  695.   FillList
  696.   ProcessOutline
  697.   
  698.   If fStartUp Then
  699.     Label1_Click
  700.     SendKeys "{Home}"   'Move selection to top of Outline.
  701.     fStartUp = False
  702.   End If
  703.  
  704. End Sub
  705.  
  706. Function stGetID (ctrl As Control)
  707.   stTxt$ = ctrl.Text
  708.   i% = InStr(stTxt$, " ")
  709.   stTmp$ = stTxt$
  710.   Do While i% <> 0
  711.     stTmp$ = Right$(stTmp$, Len(stTmp$) - i%)
  712.     i% = InStr(stTmp$, " ")
  713.   Loop
  714.   stGetID = stTmp$
  715. End Function
  716.  
  717. Function stGetToken (stLn$, stDelim$) As String
  718.     On Error GoTo GetTokenError
  719.  
  720.     iOpenQuote% = InStr(1, stLn$, """")
  721.     iDelim% = InStr(1, stLn$, stDelim$)
  722.  
  723.     If (iOpenQuote% > 0) And (iOpenQuote% < iDelim%) Then
  724.          iCloseQuote% = InStr(iOpenQuote% + 1, stLn$, """")
  725.          iDelim% = InStr(iCloseQuote% + 1, stLn$, stDelim$)
  726.     End If
  727.  
  728.     If (iDelim% <> 0) Then
  729.          stToken$ = LTrim$(RTrim$(Mid$(stLn$, 1, iDelim% - 1)))
  730.          stLn$ = Mid$(stLn$, iDelim% + 1)
  731.     Else
  732.          stToken$ = LTrim$(RTrim$(Mid$(stLn$, 1)))
  733.          stLn$ = ""
  734.     End If
  735.  
  736.     If (Len(stToken$) > 0) Then
  737.          If (Mid$(stToken$, 1, 1) = """") Then
  738.               stToken$ = Mid$(stToken$, 2)
  739.          End If
  740.          If (Mid$(stToken$, Len(stToken$), 1) = """") Then
  741.               stToken$ = Mid$(stToken$, 1, Len(stToken$) - 1)
  742.          End If
  743.     End If
  744.     stGetToken = stToken$
  745.  
  746. GetTokenExit:
  747.     Exit Function
  748.  
  749. GetTokenError:
  750.     Resume GetTokenExit
  751. End Function
  752.  
  753. Sub tAddress_KeyPress (Index As Integer, KeyAscii As Integer)
  754.   Data1.Enabled = False
  755.   cNew.Enabled = False
  756.   cDelete.Enabled = False
  757.   cUpdate.Enabled = True
  758.   
  759. End Sub
  760.  
  761. Sub tCity_KeyPress (Index As Integer, KeyAscii As Integer)
  762.   Data1.Enabled = False
  763.   cNew.Enabled = False
  764.   cDelete.Enabled = False
  765.   cUpdate.Enabled = True
  766.  
  767. End Sub
  768.  
  769. Sub tCountry_KeyPress (Index As Integer, KeyAscii As Integer)
  770.   Data1.Enabled = False
  771.   cNew.Enabled = False
  772.   cDelete.Enabled = False
  773.   cUpdate.Enabled = True
  774.  
  775. End Sub
  776.  
  777. Sub tFName_KeyPress (KeyAscii As Integer)
  778.   Data1.Enabled = False
  779.   cNew.Enabled = False
  780.   cDelete.Enabled = False
  781.   cUpdate.Enabled = True
  782. End Sub
  783.  
  784. Sub tLName_KeyPress (KeyAscii As Integer)
  785.   Data1.Enabled = False
  786.   cNew.Enabled = False
  787.   cDelete.Enabled = False
  788.   cUpdate.Enabled = True
  789. End Sub
  790.  
  791. Sub tNotes_KeyPress (KeyAscii As Integer)
  792.   Data1.Enabled = False
  793.   cNew.Enabled = False
  794.   cDelete.Enabled = False
  795.   cUpdate.Enabled = True
  796.  
  797. End Sub
  798.  
  799. Sub tPhone_KeyPress (Index As Integer, KeyAscii As Integer)
  800.   Data1.Enabled = False
  801.   cNew.Enabled = False
  802.   cDelete.Enabled = False
  803.   cUpdate.Enabled = True
  804.  
  805. End Sub
  806.  
  807. Sub tPost_KeyPress (Index As Integer, KeyAscii As Integer)
  808.   Data1.Enabled = False
  809.   cNew.Enabled = False
  810.   cDelete.Enabled = False
  811.   cUpdate.Enabled = True
  812.  
  813. End Sub
  814.  
  815. Sub tRegion_KeyPress (Index As Integer, KeyAscii As Integer)
  816.   Data1.Enabled = False
  817.   cNew.Enabled = False
  818.   cDelete.Enabled = False
  819.   cUpdate.Enabled = True
  820.  
  821. End Sub
  822.  
  823.