home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1998 October / dpcb1098.iso / Business / Maxim / MAX5 / data.z / Insform.frm < prev    next >
Text File  |  1998-05-10  |  28KB  |  809 lines

  1. VERSION 5.00
  2. Begin VB.Form Insform 
  3.    Caption         =   "Insert a new Client"
  4.    ClientHeight    =   5220
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   8550
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5220
  10.    ScaleWidth      =   8550
  11.    StartUpPosition =   1  'CenterOwner
  12.    Begin VB.TextBox EntryType 
  13.       Enabled         =   0   'False
  14.       Height          =   285
  15.       Left            =   5400
  16.       MaxLength       =   21
  17.       TabIndex        =   48
  18.       Top             =   3480
  19.       Width           =   2175
  20.    End
  21.    Begin VB.CommandButton Command3 
  22.       Caption         =   "Cle&ar"
  23.       Height          =   375
  24.       Left            =   3960
  25.       TabIndex        =   46
  26.       Top             =   4560
  27.       Width           =   1095
  28.    End
  29.    Begin VB.TextBox ID 
  30.       Enabled         =   0   'False
  31.       Height          =   285
  32.       Left            =   5400
  33.       MaxLength       =   23
  34.       TabIndex        =   31
  35.       Top             =   1680
  36.       Width           =   2175
  37.    End
  38.    Begin VB.TextBox Phone4Ext 
  39.       Height          =   285
  40.       Left            =   7680
  41.       MaxLength       =   5
  42.       TabIndex        =   43
  43.       Top             =   3120
  44.       Width           =   735
  45.    End
  46.    Begin VB.TextBox Phone4 
  47.       Height          =   285
  48.       Left            =   5400
  49.       MaxLength       =   21
  50.       TabIndex        =   42
  51.       Top             =   3120
  52.       Width           =   2175
  53.    End
  54.    Begin VB.TextBox Phone3Ext 
  55.       Height          =   285
  56.       Left            =   7680
  57.       MaxLength       =   5
  58.       TabIndex        =   40
  59.       Top             =   2760
  60.       Width           =   735
  61.    End
  62.    Begin VB.TextBox Phone3 
  63.       Height          =   285
  64.       Left            =   5400
  65.       MaxLength       =   21
  66.       TabIndex        =   39
  67.       Top             =   2760
  68.       Width           =   2175
  69.    End
  70.    Begin VB.TextBox Phone2Ext 
  71.       Height          =   285
  72.       Left            =   7680
  73.       MaxLength       =   5
  74.       TabIndex        =   37
  75.       Top             =   2400
  76.       Width           =   735
  77.    End
  78.    Begin VB.TextBox Phone2 
  79.       Height          =   285
  80.       Left            =   5400
  81.       MaxLength       =   21
  82.       TabIndex        =   36
  83.       Top             =   2400
  84.       Width           =   2175
  85.    End
  86.    Begin VB.TextBox Phone1Ext 
  87.       Height          =   285
  88.       Left            =   7680
  89.       MaxLength       =   5
  90.       TabIndex        =   34
  91.       Top             =   2040
  92.       Width           =   735
  93.    End
  94.    Begin VB.TextBox Phone1 
  95.       Height          =   285
  96.       Left            =   5400
  97.       MaxLength       =   21
  98.       TabIndex        =   33
  99.       Top             =   2040
  100.       Width           =   2175
  101.    End
  102.    Begin VB.TextBox Country 
  103.       Height          =   285
  104.       Left            =   5400
  105.       MaxLength       =   39
  106.       TabIndex        =   29
  107.       Top             =   1320
  108.       Width           =   2175
  109.    End
  110.    Begin VB.TextBox Zip 
  111.       Height          =   285
  112.       Left            =   5400
  113.       MaxLength       =   19
  114.       TabIndex        =   27
  115.       Top             =   960
  116.       Width           =   2175
  117.    End
  118.    Begin VB.TextBox State 
  119.       Height          =   285
  120.       Left            =   5400
  121.       MaxLength       =   39
  122.       TabIndex        =   25
  123.       Top             =   600
  124.       Width           =   2175
  125.    End
  126.    Begin VB.TextBox City 
  127.       Height          =   285
  128.       Left            =   5400
  129.       MaxLength       =   39
  130.       TabIndex        =   23
  131.       Top             =   240
  132.       Width           =   2175
  133.    End
  134.    Begin VB.TextBox Address2 
  135.       Height          =   285
  136.       Left            =   1440
  137.       MaxLength       =   39
  138.       TabIndex        =   21
  139.       Top             =   3840
  140.       Width           =   2175
  141.    End
  142.    Begin VB.TextBox Address1 
  143.       Height          =   285
  144.       Left            =   1440
  145.       MaxLength       =   39
  146.       TabIndex        =   19
  147.       Top             =   3480
  148.       Width           =   2175
  149.    End
  150.    Begin VB.TextBox Division 
  151.       Height          =   285
  152.       Left            =   1440
  153.       MaxLength       =   39
  154.       TabIndex        =   17
  155.       Top             =   3120
  156.       Width           =   2175
  157.    End
  158.    Begin VB.TextBox Dept 
  159.       Height          =   285
  160.       Left            =   1440
  161.       MaxLength       =   39
  162.       TabIndex        =   15
  163.       Top             =   2760
  164.       Width           =   2175
  165.    End
  166.    Begin VB.TextBox Company 
  167.       Height          =   285
  168.       Left            =   1440
  169.       MaxLength       =   59
  170.       TabIndex        =   13
  171.       Top             =   2400
  172.       Width           =   2175
  173.    End
  174.    Begin VB.TextBox Salutation 
  175.       Height          =   285
  176.       Left            =   1440
  177.       MaxLength       =   39
  178.       TabIndex        =   11
  179.       Top             =   2040
  180.       Width           =   2175
  181.    End
  182.    Begin VB.TextBox Position 
  183.       Height          =   285
  184.       Left            =   1440
  185.       MaxLength       =   59
  186.       TabIndex        =   9
  187.       Top             =   1680
  188.       Width           =   2175
  189.    End
  190.    Begin VB.TextBox LastName 
  191.       Height          =   285
  192.       Left            =   1440
  193.       MaxLength       =   59
  194.       TabIndex        =   7
  195.       Top             =   1320
  196.       Width           =   2175
  197.    End
  198.    Begin VB.TextBox Initial 
  199.       Height          =   285
  200.       Left            =   1440
  201.       MaxLength       =   1
  202.       TabIndex        =   5
  203.       Top             =   960
  204.       Width           =   2175
  205.    End
  206.    Begin VB.TextBox FirstName 
  207.       Height          =   285
  208.       Left            =   1440
  209.       MaxLength       =   39
  210.       TabIndex        =   3
  211.       Top             =   600
  212.       Width           =   2175
  213.    End
  214.    Begin VB.TextBox Mr 
  215.       Height          =   285
  216.       Left            =   1440
  217.       MaxLength       =   39
  218.       TabIndex        =   1
  219.       Top             =   240
  220.       Width           =   2175
  221.    End
  222.    Begin VB.CommandButton Command2 
  223.       Cancel          =   -1  'True
  224.       Caption         =   "Cancel"
  225.       Height          =   375
  226.       Left            =   7320
  227.       TabIndex        =   45
  228.       Top             =   4560
  229.       Width           =   1095
  230.    End
  231.    Begin VB.CommandButton Command1 
  232.       Caption         =   "&OK"
  233.       Default         =   -1  'True
  234.       Height          =   375
  235.       Left            =   5640
  236.       TabIndex        =   44
  237.       Top             =   4560
  238.       Width           =   1095
  239.    End
  240.    Begin VB.Label Label21 
  241.       Caption         =   "Entry Type"
  242.       Enabled         =   0   'False
  243.       Height          =   255
  244.       Left            =   4080
  245.       TabIndex        =   47
  246.       Top             =   3480
  247.       Width           =   1215
  248.    End
  249.    Begin VB.Label Label20 
  250.       Caption         =   "Phone &4"
  251.       Height          =   255
  252.       Left            =   4080
  253.       TabIndex        =   41
  254.       Top             =   3120
  255.       Width           =   1215
  256.    End
  257.    Begin VB.Label Label19 
  258.       Caption         =   "Phone &3"
  259.       Height          =   255
  260.       Left            =   4080
  261.       TabIndex        =   38
  262.       Top             =   2760
  263.       Width           =   1215
  264.    End
  265.    Begin VB.Label Label18 
  266.       Caption         =   "Phone &2"
  267.       Height          =   255
  268.       Left            =   4080
  269.       TabIndex        =   35
  270.       Top             =   2400
  271.       Width           =   1215
  272.    End
  273.    Begin VB.Label Label17 
  274.       Caption         =   "Phone &1"
  275.       Height          =   255
  276.       Left            =   4080
  277.       TabIndex        =   32
  278.       Top             =   2040
  279.       Width           =   1215
  280.    End
  281.    Begin VB.Label Label16 
  282.       Caption         =   "Identification"
  283.       Enabled         =   0   'False
  284.       Height          =   255
  285.       Left            =   4080
  286.       TabIndex        =   30
  287.       Top             =   1680
  288.       Width           =   1215
  289.    End
  290.    Begin VB.Label Label15 
  291.       Caption         =   "Cou&ntry"
  292.       Height          =   255
  293.       Left            =   4080
  294.       TabIndex        =   28
  295.       Top             =   1320
  296.       Width           =   1215
  297.    End
  298.    Begin VB.Label Label14 
  299.       Caption         =   "&Zip/Postal"
  300.       Height          =   255
  301.       Left            =   4080
  302.       TabIndex        =   26
  303.       Top             =   960
  304.       Width           =   1215
  305.    End
  306.    Begin VB.Label Label13 
  307.       Caption         =   "St&/Prov"
  308.       Height          =   255
  309.       Left            =   4080
  310.       TabIndex        =   24
  311.       Top             =   600
  312.       Width           =   1215
  313.    End
  314.    Begin VB.Label Label12 
  315.       Caption         =   "&City"
  316.       Height          =   255
  317.       Left            =   4080
  318.       TabIndex        =   22
  319.       Top             =   240
  320.       Width           =   1215
  321.    End
  322.    Begin VB.Label Label11 
  323.       Caption         =   "Addre&ss Line 2"
  324.       Height          =   255
  325.       Left            =   120
  326.       TabIndex        =   20
  327.       Top             =   3840
  328.       Width           =   1215
  329.    End
  330.    Begin VB.Label Label10 
  331.       Caption         =   "Add&ress Line 1"
  332.       Height          =   255
  333.       Left            =   120
  334.       TabIndex        =   18
  335.       Top             =   3480
  336.       Width           =   1215
  337.    End
  338.    Begin VB.Label Label9 
  339.       Caption         =   "Di&vision"
  340.       Height          =   255
  341.       Left            =   120
  342.       TabIndex        =   16
  343.       Top             =   3120
  344.       Width           =   1215
  345.    End
  346.    Begin VB.Label Label8 
  347.       Caption         =   "D&ept"
  348.       Height          =   255
  349.       Left            =   120
  350.       TabIndex        =   14
  351.       Top             =   2760
  352.       Width           =   1215
  353.    End
  354.    Begin VB.Label Label7 
  355.       Caption         =   "Compan&y Name"
  356.       Height          =   255
  357.       Left            =   120
  358.       TabIndex        =   12
  359.       Top             =   2400
  360.       Width           =   1215
  361.    End
  362.    Begin VB.Label Label6 
  363.       Caption         =   "Salu&tation"
  364.       Height          =   255
  365.       Left            =   120
  366.       TabIndex        =   10
  367.       Top             =   2040
  368.       Width           =   1215
  369.    End
  370.    Begin VB.Label Label5 
  371.       Caption         =   "&Position"
  372.       Height          =   255
  373.       Left            =   120
  374.       TabIndex        =   8
  375.       Top             =   1680
  376.       Width           =   1215
  377.    End
  378.    Begin VB.Label Label4 
  379.       Caption         =   "&Last Name"
  380.       Height          =   255
  381.       Left            =   120
  382.       TabIndex        =   6
  383.       Top             =   1320
  384.       Width           =   1215
  385.    End
  386.    Begin VB.Label Label3 
  387.       Caption         =   "&Initial"
  388.       Height          =   255
  389.       Left            =   120
  390.       TabIndex        =   4
  391.       Top             =   960
  392.       Width           =   1215
  393.    End
  394.    Begin VB.Label Label2 
  395.       Caption         =   "&First Name"
  396.       Height          =   255
  397.       Left            =   120
  398.       TabIndex        =   2
  399.       Top             =   600
  400.       Width           =   1215
  401.    End
  402.    Begin VB.Label Label1 
  403.       Caption         =   "&Mr/Ms"
  404.       Height          =   255
  405.       Left            =   120
  406.       TabIndex        =   0
  407.       Top             =   240
  408.       Width           =   1215
  409.    End
  410. End
  411. Attribute VB_Name = "Insform"
  412. Attribute VB_GlobalNameSpace = False
  413. Attribute VB_Creatable = False
  414. Attribute VB_PredeclaredId = True
  415. Attribute VB_Exposed = False
  416. '==========================================================================
  417. '
  418. '  This code and information is provided "as is" without warranty of any
  419. '  kind, either expressed or implied, including but not limited to the
  420. '  implied warranties of merchantability and/or fitness for a particular
  421. '  purpose..
  422. '
  423. '  Copyright (c) 1998  Multiactive Software Inc.  All Rights Reserved.
  424. '
  425. '==========================================================================
  426.  
  427. Private Sub Command1_Click()  'Company
  428.  
  429. If ClientInsertType = 1 Then                  'If this is Company
  430.         If Insform.Company <> "" Then          'If Lastname field isn't empty then
  431.             Call InsertCompany
  432.         Else
  433.             MsgBox ("Company Name is a Required field.") 'Warn User that Last name is required
  434.             Insform.Company.SetFocus                         'Set Focus back to the Last_Name field.
  435.             Exit Sub
  436.         End If
  437. End If
  438.  
  439. If ClientInsertType = 2 Then    'Contact to current client
  440.     
  441.     If Insform.LastName <> "" Then 'If Lastname has data
  442.                 Call InsertContact                  'Then call Subroutine to Insert the Contact
  443.     Else
  444.             MsgBox ("Last Name is a required field.") 'Warn user that a name is required
  445.             Insform.LastName.SetFocus                   'Set focus in the Lastname field
  446.             Exit Sub
  447.     End If
  448. End If
  449.  
  450. If ClientInsertType = 3 Then   'If InsertType is an Individual
  451.         If Insform.LastName <> "" Then  'If Lastname is not blank
  452.             Call InsertIndividual              'Call Subroutine to insert Individual
  453.         Else
  454.             MsgBox ("Last Name is a Required field.") 'Warn user that Last Name is Required
  455.             Insform.LastName.SetFocus 'SetFocus back to the Lastname field
  456.             Exit Sub
  457.         End If
  458. End If
  459.         
  460. If ClientInsertType = 4 Then   'If the InsertType is a contact of new company Then
  461.            
  462.     If Insform.Company <> "" And Insform.LastName <> "" Then 'If both Company and Lastname have data
  463.             Call InsertCompany                  'First call Subroutine to Insert the Company
  464.             
  465.             Set dbsrecClientMax = dbs.OpenRecordset("SELECT MAX(Sequence_Number) FROM Client") 'Get the new entry info by using the biggest sequence number
  466.             TempSeqNum = dbsrecClientMax.Fields(0)
  467.             Set dbsrecClientTemp = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client WHERE Sequence_Number=" & TempSeqNum)
  468.             ci = dbsrecClientTemp.Fields(0)
  469.             cn = dbsrecClientTemp.Fields(1)
  470.             rectype = dbsrecClientTemp.Fields(2)
  471.             ClientForm.ID = ci
  472.             
  473.             If rectype = 1 Then 'If it is a company
  474.                 Call InsertContact                  'Then call Subroutine to Insert the Contact
  475.             Else
  476.                 MsgBox ("Error to get the new Company Id. Company client is already created.")
  477.             End If
  478.     Else
  479.             MsgBox ("Last Name and Company are required fields.") 'Warn user that a name is required
  480.             Insform.LastName.SetFocus                   'Set focus in the Lastname field
  481.             Exit Sub
  482.     End If
  483. End If
  484.  
  485.     dbsrecClient.Close
  486.     dbs.Close
  487.     
  488.     'To get the new entry's info by using the sequence number and update the recordsets
  489.     Set dbs = OpenDatabase("", False, False, "ODBC;DSN=" & DSN & ";UID=" & UID & ";PWD=" & PWD & ";")
  490.     Set dbsrecClient = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client")
  491.     Set dbsrecClientMax = dbs.OpenRecordset("SELECT MAX(Sequence_Number) FROM Client")
  492.     TempSeqNum = dbsrecClientMax.Fields(0)
  493.     Set dbsrecClientTemp = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client WHERE Sequence_Number=" & TempSeqNum)
  494.     ci = dbsrecClientTemp.Fields(0)
  495.     cn = dbsrecClientTemp.Fields(1)
  496.     rectype = dbsrecClientTemp.Fields(2)
  497.  
  498. dbsrecClientMax.Close
  499. dbsrecClientTemp.Close
  500. Persform.Show   'Display the Persform
  501. Unload Me       'Terminate this form
  502.  
  503. End Sub
  504.  
  505. Private Sub Command2_Click()  'Cancel
  506.     Persform.Show
  507.     Unload Me   'User chose Cancel, so Unload the form without doing anything
  508. End Sub
  509.  
  510. Private Sub Command3_Click()  'Clear
  511.     Set ClientForm = Insform
  512.     Call ClearFields
  513.     Set ClientForm = Nothing
  514. End Sub
  515.  
  516. Private Sub Form_Load()
  517.     Set ClientForm = Insform
  518.     Call ClearFields    'Clear all the fields
  519.     Set ClientForm = Nothing
  520.     If ClientInsertType = 1 Then        'If the user chose Company
  521.     
  522.     'Setup the form
  523.         Insform.EntryType.Text = "Company"
  524.         Insform.ID.Enabled = True
  525.         Insform.Label16.Enabled = True
  526.         Insform.Mr.Enabled = False
  527.         Insform.FirstName.Enabled = False
  528.         Insform.Initial.Enabled = False
  529.         Insform.LastName.Enabled = False
  530.         Insform.Position.Enabled = False
  531.         Insform.Salutation.Enabled = False
  532.         Insform.Label1.Enabled = False
  533.         Insform.Label2.Enabled = False
  534.         Insform.Label3.Enabled = False
  535.         Insform.Label4.Enabled = False
  536.         Insform.Label5.Enabled = False
  537.         Insform.Label6.Enabled = False
  538.         Insform.Label7.Enabled = True
  539.         Insform.Label8.Enabled = True
  540.         Insform.Label9.Enabled = True
  541.         Insform.Label10.Enabled = True
  542.         Insform.Label11.Enabled = True
  543.         Insform.Label12.Enabled = True
  544.         Insform.Label13.Enabled = True
  545.         Insform.Label14.Enabled = True
  546.         Insform.Label15.Enabled = True
  547.         Insform.Company.Enabled = True
  548.         Insform.Dept.Enabled = True
  549.         Insform.Division.Enabled = True
  550.         Insform.Address1.Enabled = True
  551.         Insform.Address2.Enabled = True
  552.         Insform.City.Enabled = True
  553.         Insform.State.Enabled = True
  554.         Insform.Zip.Enabled = True
  555.         Insform.Country.Enabled = True
  556.         
  557.     ElseIf ClientInsertType = 2 Then    'If the user chose Contact of the current entry
  558.         If rectype = 2 Or rectype = 32 Then 'If Individual or Individual contact
  559.             Set ClientForm = Insform
  560.             Call Personfill(0)      'Fill out the pre-setup fields
  561.             Set ClientForm = Nothing
  562.             'Setup the form
  563.             Insform.EntryType.Text = "Individual Contact"
  564.             Insform.ID.Enabled = False
  565.             Insform.Label16.Enabled = False
  566.             Insform.ID.Text = ci
  567.             Insform.Mr.Enabled = True
  568.             Insform.FirstName.Enabled = True
  569.             Insform.Initial.Enabled = True
  570.             Insform.LastName.Enabled = True
  571.             Insform.Position.Enabled = True
  572.             Insform.Salutation.Enabled = True
  573.             Insform.Label1.Enabled = True
  574.             Insform.Label2.Enabled = True
  575.             Insform.Label3.Enabled = True
  576.             Insform.Label4.Enabled = True
  577.             Insform.Label5.Enabled = True
  578.             Insform.Label6.Enabled = True
  579.             Insform.Label7.Enabled = False
  580.             Insform.Label8.Enabled = False
  581.             Insform.Label9.Enabled = False
  582.             Insform.Label10.Enabled = False
  583.             Insform.Label11.Enabled = False
  584.             Insform.Label12.Enabled = False
  585.             Insform.Label13.Enabled = False
  586.             Insform.Label14.Enabled = False
  587.             Insform.Label15.Enabled = False
  588.             Insform.Company.Enabled = False
  589.             Insform.Dept.Enabled = False
  590.             Insform.Division.Enabled = False
  591.             Insform.Address1.Enabled = False
  592.             Insform.Address2.Enabled = False
  593.             Insform.City.Enabled = False
  594.             Insform.State.Enabled = False
  595.             Insform.Zip.Enabled = False
  596.             Insform.Country.Enabled = False
  597.             Insform.Mr.Text = ""
  598.             Insform.FirstName.Text = ""
  599.             Insform.Initial.Text = ""
  600.             Insform.LastName.Text = ""
  601.             Insform.Position.Text = ""
  602.             Insform.Salutation.Text = ""
  603.             
  604.         ElseIf rectype = 1 Or rectype = 31 Then 'If Company or Company Contact
  605.             Set ClientForm = Insform
  606.             Call Companyfill(0)     'Fill out the pre-setup fields
  607.             Set ClientForm = Nothing
  608.             'Setup the form
  609.             Insform.EntryType.Text = "Company Contact"
  610.             Insform.ID.Enabled = False
  611.             Insform.Label16.Enabled = False
  612.             Insform.ID.Text = ci
  613.             Insform.Mr.Enabled = True
  614.             Insform.FirstName.Enabled = True
  615.             Insform.Initial.Enabled = True
  616.             Insform.LastName.Enabled = True
  617.             Insform.Position.Enabled = True
  618.             Insform.Salutation.Enabled = True
  619.             Insform.Label1.Enabled = True
  620.             Insform.Label2.Enabled = True
  621.             Insform.Label3.Enabled = True
  622.             Insform.Label4.Enabled = True
  623.             Insform.Label5.Enabled = True
  624.             Insform.Label6.Enabled = True
  625.             Insform.Label7.Enabled = False
  626.             Insform.Label8.Enabled = False
  627.             Insform.Label9.Enabled = False
  628.             Insform.Label10.Enabled = False
  629.             Insform.Label11.Enabled = False
  630.             Insform.Label12.Enabled = False
  631.             Insform.Label13.Enabled = False
  632.             Insform.Label14.Enabled = False
  633.             Insform.Label15.Enabled = False
  634.             Insform.Company.Enabled = False
  635.             Insform.Dept.Enabled = False
  636.             Insform.Division.Enabled = False
  637.             Insform.Address1.Enabled = False
  638.             Insform.Address2.Enabled = False
  639.             Insform.City.Enabled = False
  640.             Insform.State.Enabled = False
  641.             Insform.Zip.Enabled = False
  642.             Insform.Country.Enabled = False
  643.         End If
  644.     ElseIf ClientInsertType = 3 Then    'If the user chose Individual
  645.             'Setup the form
  646.             Insform.EntryType.Text = "Individual"
  647.             Insform.ID.Enabled = True
  648.             Insform.Label16.Enabled = True
  649.             Insform.Mr.Enabled = True
  650.             Insform.FirstName.Enabled = True
  651.             Insform.Initial.Enabled = True
  652.             Insform.LastName.Enabled = True
  653.             Insform.Position.Enabled = True
  654.             Insform.Salutation.Enabled = True
  655.             Insform.Label1.Enabled = True
  656.             Insform.Label2.Enabled = True
  657.             Insform.Label3.Enabled = True
  658.             Insform.Label4.Enabled = True
  659.             Insform.Label5.Enabled = True
  660.             Insform.Label6.Enabled = True
  661.             Insform.Label7.Enabled = True
  662.             Insform.Label8.Enabled = True
  663.             Insform.Label9.Enabled = True
  664.             Insform.Label10.Enabled = True
  665.             Insform.Label11.Enabled = True
  666.             Insform.Label12.Enabled = True
  667.             Insform.Label13.Enabled = True
  668.             Insform.Label14.Enabled = True
  669.             Insform.Label15.Enabled = True
  670.             Insform.Company.Enabled = True
  671.             Insform.Dept.Enabled = True
  672.             Insform.Division.Enabled = True
  673.             Insform.Address1.Enabled = True
  674.             Insform.Address2.Enabled = True
  675.             Insform.City.Enabled = True
  676.             Insform.State.Enabled = True
  677.             Insform.Zip.Enabled = True
  678.             Insform.Country.Enabled = True
  679.     ElseIf ClientInsertType = 4 Then    'If the user chose Contact of new Company entry
  680.             'Setup the form
  681.             Insform.EntryType.Text = "Company and Contact"
  682.             Insform.ID.Enabled = True
  683.             Insform.Label16.Enabled = True
  684.             Insform.Mr.Enabled = True
  685.             Insform.FirstName.Enabled = True
  686.             Insform.Initial.Enabled = True
  687.             Insform.LastName.Enabled = True
  688.             Insform.Position.Enabled = True
  689.             Insform.Salutation.Enabled = True
  690.             Insform.Label1.Enabled = True
  691.             Insform.Label2.Enabled = True
  692.             Insform.Label3.Enabled = True
  693.             Insform.Label4.Enabled = True
  694.             Insform.Label5.Enabled = True
  695.             Insform.Label6.Enabled = True
  696.             Insform.Label7.Enabled = True
  697.             Insform.Label8.Enabled = True
  698.             Insform.Label9.Enabled = True
  699.             Insform.Label10.Enabled = True
  700.             Insform.Label11.Enabled = True
  701.             Insform.Label12.Enabled = True
  702.             Insform.Label13.Enabled = True
  703.             Insform.Label14.Enabled = True
  704.             Insform.Label15.Enabled = True
  705.             Insform.Company.Enabled = True
  706.             Insform.Dept.Enabled = True
  707.             Insform.Division.Enabled = True
  708.             Insform.Address1.Enabled = True
  709.             Insform.Address2.Enabled = True
  710.             Insform.City.Enabled = True
  711.             Insform.State.Enabled = True
  712.             Insform.Zip.Enabled = True
  713.             Insform.Country.Enabled = True
  714.     End If
  715.             
  716. End Sub
  717.  
  718. Private Sub Mr_GotFocus()
  719. Call SelText(Insform.Mr, 40) 'Call function to Highlight text in this field.
  720. End Sub
  721.  
  722. Private Sub FirstName_GotFocus()
  723. Call SelText(Insform.FirstName, 40) 'Call function to Highlight text in this field.
  724. End Sub
  725.  
  726. Private Sub Initial_GotFocus()
  727. Call SelText(Insform.Initial, 2) 'Call function to Highlight text in this field.
  728. End Sub
  729.  
  730. Private Sub LastName_GotFocus()
  731. Call SelText(Insform.LastName, 60) 'Call function to Highlight text in this field.
  732. End Sub
  733.  
  734. Private Sub Position_GotFocus()
  735. Call SelText(Insform.Position, 60) 'Call function to Highlight text in this field.
  736. End Sub
  737.  
  738. Private Sub Salutation_GotFocus()
  739. Call SelText(Insform.Salutation, 40) 'Call function to Highlight text in this field.
  740. End Sub
  741.  
  742. Private Sub Company_GotFocus()
  743. Call SelText(Insform.Company, 60) 'Call function to Highlight text in this field.
  744. End Sub
  745.  
  746. Private Sub Dept_GotFocus()
  747. Call SelText(Insform.Dept, 40) 'Call function to Highlight text in this field.
  748. End Sub
  749.  
  750. Private Sub Division_GotFocus()
  751. Call SelText(Insform.Division, 40) 'Call function to Highlight text in this field.
  752. End Sub
  753.  
  754. Private Sub Address1_GotFocus()
  755. Call SelText(Insform.Address1, 40) 'Call function to Highlight text in this field.
  756. End Sub
  757.  
  758. Private Sub Address2_GotFocus()
  759. Call SelText(Insform.Address2, 40) 'Call function to Highlight text in this field.
  760. End Sub
  761.  
  762. Private Sub City_GotFocus()
  763. Call SelText(Insform.City, 40) 'Call function to Highlight text in this field.
  764. End Sub
  765.  
  766. Private Sub State_GotFocus()
  767. Call SelText(Insform.State, 40) 'Call function to Highlight text in this field.
  768. End Sub
  769.  
  770. Private Sub Zip_GotFocus()
  771. Call SelText(Insform.Zip, 20) 'Call function to Highlight text in this field.
  772. End Sub
  773.  
  774. Private Sub Country_GotFocus()
  775. Call SelText(Insform.Country, 40) 'Call function to Highlight text in this field.
  776. End Sub
  777.  
  778. Private Sub Phone1_GotFocus()
  779. Call SelText(Insform.Phone1, 22) 'Call function to Highlight text in this field.
  780. End Sub
  781.  
  782. Private Sub Phone2_GotFocus()
  783. Call SelText(Insform.Phone2, 22) 'Call function to Highlight text in this field.
  784. End Sub
  785.  
  786. Private Sub Phone3_GotFocus()
  787. Call SelText(Insform.Phone3, 22) 'Call function to Highlight text in this field.
  788. End Sub
  789.  
  790. Private Sub Phone4_GotFocus()
  791. Call SelText(Insform.Phone4, 22) 'Call function to Highlight text in this field.
  792. End Sub
  793.  
  794. Private Sub Phone1Ext_GotFocus()
  795. Call SelText(Insform.Phone1Ext, 6) 'Call function to Highlight text in this field.
  796. End Sub
  797.  
  798. Private Sub Phone2Ext_GotFocus()
  799. Call SelText(Insform.Phone2Ext, 6) 'Call function to Highlight text in this field.
  800. End Sub
  801.  
  802. Private Sub Phone3Ext_GotFocus()
  803. Call SelText(Insform.Phone3Ext, 6) 'Call function to Highlight text in this field.
  804. End Sub
  805.  
  806. Private Sub Phone4Ext_GotFocus()
  807. Call SelText(Insform.Phone4Ext, 6) 'Call function to Highlight text in this field.
  808. End Sub
  809.