home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l405 / 3.ddi / PHONE.FR_ / PHONE.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  21.4 KB  |  722 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. Dim DBName As String
  343. Dim gLIBDB As Database
  344. Dim gDS As DynaSet
  345. Dim gCode As String
  346. Dim iCurrentRecord As Integer
  347. Dim fAll As Integer
  348. Dim CurrRec As Integer
  349. Dim fStartUp As Integer
  350. Dim iEditMode As Integer
  351. Const EM_NOTHING = 0
  352. Const EM_EDIT = 1
  353. Const EM_ADDNEW = 2
  354. Const YES = 6
  355. Const MSGBOX_TYPE = 4 + 48
  356. Sub cDelete_Click ()
  357.   If Outline1.Indent(Outline1.ListIndex) = 2 Then   'Expanded name.
  358.     Outline1.RemoveItem Outline1.ListIndex
  359.   Else
  360.     Outline1.Expand(Outline1.ListIndex) = True
  361.     For i = Outline1.ListIndex To Outline1.ListCount - 1
  362.       If Outline1.List(i) = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName Then
  363.         Outline1.RemoveItem i
  364.         Exit For
  365.       End If
  366.     Next i
  367.   End If
  368.   Data1.Recordset.Delete
  369.   Data1.Recordset.MoveNext
  370.   If Data1.Recordset.EOF Then Data1.Recordset.MovePrevious
  371.   Outline1.SetFocus
  372. End Sub
  373. Sub closedb ()
  374.   On Error Resume Next
  375.   gLIBDB.Close
  376. End Sub
  377. Sub cNew_Click ()
  378.   On Error GoTo cNewErr
  379.   CurrRec = Data1.Recordset!ID
  380.   Data1.Recordset.AddNew
  381.   Data1.Caption = "New Record"
  382.   Data1.Enabled = False
  383.   cNew.Enabled = False
  384.   cDelete.Enabled = False
  385.   cUpdate.Enabled = True
  386.   tLName.SetFocus
  387.   GoTo cNewEnd
  388. cNewErr:
  389.   If Err = 3021 Then Resume Next
  390.   MsgBox Error$
  391.   Resume cNewEnd
  392. cNewEnd:
  393. End Sub
  394. Sub cUpdate_Click ()
  395.   If tLName <> "" And tFName <> "" Then
  396.     If Data1.EditMode = EM_ADDNEW Then
  397.       Data1.Recordset.Update
  398.       If Data1.EditMode = 0 Then    'Did record get written?
  399.         Data1.Recordset.MoveLast
  400.         CurrRec = Data1.Recordset!ID
  401.         Data1.Refresh
  402.         FillList
  403.         ProcessOutline
  404.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  405.       Else
  406.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  407.       End If
  408.     Else
  409.       Data1.Recordset.Update
  410.       If Data1.EditMode = 0 Then
  411.         CurrRec = Data1.Recordset!ID
  412.         Data1.Refresh
  413.         FillList
  414.         ProcessOutline
  415.         Data1.Recordset.FindFirst "ID = " + CStr(CurrRec)
  416.       Else
  417.         Data1.UpdateControls
  418.       End If
  419.     End If
  420.     Data1.Enabled = True
  421.     cNew.Enabled = True
  422.     cDelete.Enabled = True
  423.     cUpdate.Enabled = False
  424.     Outline1.SetFocus
  425.   Else
  426.     MsgBox "First and last name must have a value"
  427.   End If
  428. End Sub
  429. Sub Data1_RePosition ()
  430.   gCode = tNotes.Text
  431.   If Not Data1.Recordset.EOF Then
  432.     'Set the Data Control's caption:
  433.     If Not IsNull(Data1.Recordset!LastName) And Not IsNull(Data1.Recordset!FirstName) Then
  434.       Data1.Caption = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName
  435.     Else
  436.       Data1.Caption = ""
  437.     End If
  438.     'Set Outline Control's selection to match current record:
  439.     For i% = 0 To Outline1.ListCount - 1
  440.       If Outline1.List(i%) = Data1.Recordset!LastName + ", " + Data1.Recordset!FirstName Then
  441.         Outline1.ListIndex = i%
  442.         If Not Outline1.IsItemVisible(Outline1.ListIndex) Then
  443.           'Set focus to first level item:
  444.           stChar = Left(Outline1.FullPath(Outline1.ListIndex), 1)
  445.           Do While stChar <> Outline1.List(Outline1.ListIndex)
  446.             Outline1.ListIndex = Outline1.ListIndex - 1
  447.           Loop
  448.         End If
  449.         Exit For
  450.       End If
  451.     Next i%
  452.   Else
  453.     Data1.Caption = "No records found!"
  454.   End If
  455. End Sub
  456. Sub Data1_Validate (Action As Integer, Save As Integer)
  457.   Select Case Action
  458.     Case 1          'First
  459.     Case 2          'Previous
  460.     Case 3          'Next
  461.     Case 4          'Last
  462.     Case 5          'AddNew
  463.     Case 6          'Update
  464.       If Save = True Then
  465.         If MsgBox("Commit Changes?", MSGBOX_TYPE) <> YES Then Action = 0: Save = False
  466.       End If
  467.     Case 7          'Delete
  468.         
  469.     Case 8
  470.       Save = False
  471.     Case 9          'BookMark
  472.     Case 10          'Close
  473.       If Save = True Then
  474.         If MsgBox("Commit Changes before Closing?", MSGBOX_TYPE) <> YES Then Save = False
  475.       End If
  476.   End Select
  477. End Sub
  478. Sub FillList ()
  479.   On Error GoTo FillPhoneErr
  480.   Set gDS = Data1.Recordset.Clone()
  481.   Outline1.Clear
  482.   'Fill top level A-Z
  483.   For i = 0 To 25
  484.       Outline1.AddItem Chr$(65 + i)
  485.       Outline1.Indent(Outline1.ListCount - 1) = 1
  486.       'Add Names
  487.       Do While Not gDS.EOF
  488.             If UCase(Left(gDS!LastName, 1)) = Chr$(65 + i) Then
  489.               Outline1.AddItem gDS!LastName + ", " + gDS!FirstName
  490.               Outline1.Indent(Outline1.ListCount - 1) = 2
  491.               gDS.MoveNext
  492.             Else
  493.               Exit Do
  494.             End If
  495.       Loop
  496.   Next i
  497. EndOfData:
  498.   Exit Sub
  499. FillPhoneErr:
  500.   MsgBox Error(Err)
  501.   Resume Next
  502.   Exit Sub
  503. End Sub
  504. Sub Form_Load ()
  505.   DBName = App.Path + "\phone.mdb"
  506.   fStartUp = True
  507.   Data1.DatabaseName = DBName
  508.   X% = OpenDB(DBName)
  509.   Load tPhone(1)
  510.   Load tAddress(1)
  511.   Load tCity(1)
  512.   Load tRegion(1)
  513.   Load tCountry(1)
  514.   Load tPost(1)
  515.   cUpdate.Enabled = False
  516.   RefreshForm
  517. End Sub
  518. Sub Label1_Click ()
  519.   Picture2.Picture = pTab1.Picture
  520.   Picture1.Visible = True
  521.   tPhone(0).Visible = True
  522.   tAddress(0).Visible = True
  523.   tCity(0).Visible = True
  524.   tRegion(0).Visible = True
  525.   tCountry(0).Visible = True
  526.   tPost(0).Visible = True
  527.   tPhone(1).Visible = False
  528.   tAddress(1).Visible = False
  529.   tCity(1).Visible = False
  530.   tRegion(1).Visible = False
  531.   tCountry(1).Visible = False
  532.   tPost(1).Visible = False
  533.   tNotes.Visible = False
  534. End Sub
  535. Sub Label2_Click ()
  536.   Picture2.Picture = pTab2.Picture
  537.   Picture1.Visible = True
  538.   tPhone(1).Visible = True
  539.   tAddress(1).Visible = True
  540.   tCity(1).Visible = True
  541.   tRegion(1).Visible = True
  542.   tCountry(1).Visible = True
  543.   tPost(1).Visible = True
  544.   tPhone(0).Visible = False
  545.   tAddress(0).Visible = False
  546.   tCity(0).Visible = False
  547.   tRegion(0).Visible = False
  548.   tCountry(0).Visible = False
  549.   tPost(0).Visible = False
  550.   tNotes.Visible = False
  551. End Sub
  552. Sub Label3_Click ()
  553.   Picture2.Picture = pTab3.Picture
  554.   Picture1.Visible = False
  555.   tNotes.Visible = True
  556. End Sub
  557. Function OpenDB (DBName As String) As Integer
  558.   Dim Connect As String
  559.   On Error GoTo OpenDBErr
  560.   Set gLIBDB = OpenDatabase(DBName)
  561.   'success
  562.   OpenDB = True
  563.   GoTo OpenDBEnd
  564. OpenDBErr:
  565.   OpenDB = False
  566.   Resume OpenDBEnd
  567. OpenDBEnd:
  568.       
  569. End Function
  570. Sub Outline1_Click ()
  571.   Dim stLName As String
  572.   Dim stFName As String
  573.   If Outline1.Indent(Outline1.ListIndex) = 2 Then
  574.     stTmp$ = Outline1.List(Outline1.ListIndex)
  575.     stLName = stGetToken$(stTmp$, ",")
  576.     stFName = Right(stTmp$, Len(stTmp$) - 1)
  577.     Data1.Recordset.FindFirst "LastName='" + stLName + "' and FirstNAME='" + stFName + "'"
  578.   End If
  579. End Sub
  580. Sub Outline1_Collapse (i As Integer)
  581.   Outline1.ListIndex = i
  582. End Sub
  583. Sub Outline1_DblClick ()
  584.   If Outline1.Expand(Outline1.ListIndex) Then
  585.     Outline1.Expand(Outline1.ListIndex) = False
  586.   Else
  587.     Outline1.Expand(Outline1.ListIndex) = True
  588.   End If
  589. End Sub
  590. Sub Outline1_Expand (i As Integer)
  591.   Outline1.ListIndex = i
  592. End Sub
  593. Sub Outline1_KeyPress (KeyAscii As Integer)
  594.   If KeyAscii = 13 Then
  595.     Outline1_DblClick
  596.   End If
  597. End Sub
  598. Sub ProcessOutline ()
  599.   For i% = 0 To Outline1.ListCount - 1
  600.     If Outline1.HasSubItems(i%) Then
  601.       Outline1.Expand(i%) = False
  602.     End If
  603.   Next i%
  604. End Sub
  605. Sub RefreshForm ()
  606.   Data1.RecordSource = "select * from PhoneList order by LastName,FirstName"
  607.   Data1.Refresh
  608.   'Set DataField properties for control array
  609.   tPhone(0).DataField = "WorkPhone"
  610.   tAddress(0).DataField = "WorkAddress"
  611.   tCity(0).DataField = "WorkCity"
  612.   tRegion(0).DataField = "WorkRegion"
  613.   tCountry(0).DataField = "WorkCountry"
  614.   tPost(0).DataField = "WorkPostalCode"
  615.   tPhone(1).DataField = "HomePhone"
  616.   tAddress(1).DataField = "HomeAddress"
  617.   tCity(1).DataField = "HomeCity"
  618.   tRegion(1).DataField = "HomeRegion"
  619.   tCountry(1).DataField = "HomeCountry"
  620.   tPost(1).DataField = "HomePostalCode"
  621.   FillList
  622.   ProcessOutline
  623.   If fStartUp Then
  624.     Label1_Click
  625.     SendKeys "{Home}"   'Move selection to top of Outline.
  626.     fStartUp = False
  627.   End If
  628. End Sub
  629. Function stGetID (ctrl As Control)
  630.   stTxt$ = ctrl.Text
  631.   i% = InStr(stTxt$, " ")
  632.   stTmp$ = stTxt$
  633.   Do While i% <> 0
  634.     stTmp$ = Right$(stTmp$, Len(stTmp$) - i%)
  635.     i% = InStr(stTmp$, " ")
  636.   Loop
  637.   stGetID = stTmp$
  638. End Function
  639. Function stGetToken (stLn$, stDelim$) As String
  640.     On Error GoTo GetTokenError
  641.     iOpenQuote% = InStr(1, stLn$, """")
  642.     iDelim% = InStr(1, stLn$, stDelim$)
  643.     If (iOpenQuote% > 0) And (iOpenQuote% < iDelim%) Then
  644.          iCloseQuote% = InStr(iOpenQuote% + 1, stLn$, """")
  645.          iDelim% = InStr(iCloseQuote% + 1, stLn$, stDelim$)
  646.     End If
  647.     If (iDelim% <> 0) Then
  648.          stToken$ = LTrim$(RTrim$(Mid$(stLn$, 1, iDelim% - 1)))
  649.          stLn$ = Mid$(stLn$, iDelim% + 1)
  650.     Else
  651.          stToken$ = LTrim$(RTrim$(Mid$(stLn$, 1)))
  652.          stLn$ = ""
  653.     End If
  654.     If (Len(stToken$) > 0) Then
  655.          If (Mid$(stToken$, 1, 1) = """") Then
  656.               stToken$ = Mid$(stToken$, 2)
  657.          End If
  658.          If (Mid$(stToken$, Len(stToken$), 1) = """") Then
  659.               stToken$ = Mid$(stToken$, 1, Len(stToken$) - 1)
  660.          End If
  661.     End If
  662.     stGetToken = stToken$
  663. GetTokenExit:
  664.     Exit Function
  665. GetTokenError:
  666.     Resume GetTokenExit
  667. End Function
  668. Sub tAddress_KeyPress (Index As Integer, KeyAscii As Integer)
  669.   Data1.Enabled = False
  670.   cNew.Enabled = False
  671.   cDelete.Enabled = False
  672.   cUpdate.Enabled = True
  673. End Sub
  674. Sub tCity_KeyPress (Index As Integer, KeyAscii As Integer)
  675.   Data1.Enabled = False
  676.   cNew.Enabled = False
  677.   cDelete.Enabled = False
  678.   cUpdate.Enabled = True
  679. End Sub
  680. Sub tCountry_KeyPress (Index As Integer, KeyAscii As Integer)
  681.   Data1.Enabled = False
  682.   cNew.Enabled = False
  683.   cDelete.Enabled = False
  684.   cUpdate.Enabled = True
  685. End Sub
  686. Sub tFName_KeyPress (KeyAscii As Integer)
  687.   Data1.Enabled = False
  688.   cNew.Enabled = False
  689.   cDelete.Enabled = False
  690.   cUpdate.Enabled = True
  691. End Sub
  692. Sub tLName_KeyPress (KeyAscii As Integer)
  693.   Data1.Enabled = False
  694.   cNew.Enabled = False
  695.   cDelete.Enabled = False
  696.   cUpdate.Enabled = True
  697. End Sub
  698. Sub tNotes_KeyPress (KeyAscii As Integer)
  699.   Data1.Enabled = False
  700.   cNew.Enabled = False
  701.   cDelete.Enabled = False
  702.   cUpdate.Enabled = True
  703. End Sub
  704. Sub tPhone_KeyPress (Index As Integer, KeyAscii As Integer)
  705.   Data1.Enabled = False
  706.   cNew.Enabled = False
  707.   cDelete.Enabled = False
  708.   cUpdate.Enabled = True
  709. End Sub
  710. Sub tPost_KeyPress (Index As Integer, KeyAscii As Integer)
  711.   Data1.Enabled = False
  712.   cNew.Enabled = False
  713.   cDelete.Enabled = False
  714.   cUpdate.Enabled = True
  715. End Sub
  716. Sub tRegion_KeyPress (Index As Integer, KeyAscii As Integer)
  717.   Data1.Enabled = False
  718.   cNew.Enabled = False
  719.   cDelete.Enabled = False
  720.   cUpdate.Enabled = True
  721. End Sub
  722.