home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1998 October / dpcb1098.iso / Business / Maxim / MAX5 / data.z / Insform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-05-10  |  27.1 KB  |  769 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. Attribute VB_Name = "Insform"
  411. Attribute VB_GlobalNameSpace = False
  412. Attribute VB_Creatable = False
  413. Attribute VB_PredeclaredId = True
  414. Attribute VB_Exposed = False
  415. '==========================================================================
  416. '  This code and information is provided "as is" without warranty of any
  417. '  kind, either expressed or implied, including but not limited to the
  418. '  implied warranties of merchantability and/or fitness for a particular
  419. '  purpose..
  420. '  Copyright (c) 1998  Multiactive Software Inc.  All Rights Reserved.
  421. '==========================================================================
  422. Private Sub Command1_Click()  'Company
  423. If ClientInsertType = 1 Then                  'If this is Company
  424.         If Insform.Company <> "" Then          'If Lastname field isn't empty then
  425.             Call InsertCompany
  426.         Else
  427.             MsgBox ("Company Name is a Required field.") 'Warn User that Last name is required
  428.             Insform.Company.SetFocus                         'Set Focus back to the Last_Name field.
  429.             Exit Sub
  430.         End If
  431. End If
  432. If ClientInsertType = 2 Then    'Contact to current client
  433.     If Insform.LastName <> "" Then 'If Lastname has data
  434.                 Call InsertContact                  'Then call Subroutine to Insert the Contact
  435.     Else
  436.             MsgBox ("Last Name is a required field.") 'Warn user that a name is required
  437.             Insform.LastName.SetFocus                   'Set focus in the Lastname field
  438.             Exit Sub
  439.     End If
  440. End If
  441. If ClientInsertType = 3 Then   'If InsertType is an Individual
  442.         If Insform.LastName <> "" Then  'If Lastname is not blank
  443.             Call InsertIndividual              'Call Subroutine to insert Individual
  444.         Else
  445.             MsgBox ("Last Name is a Required field.") 'Warn user that Last Name is Required
  446.             Insform.LastName.SetFocus 'SetFocus back to the Lastname field
  447.             Exit Sub
  448.         End If
  449. End If
  450.         
  451. If ClientInsertType = 4 Then   'If the InsertType is a contact of new company Then
  452.            
  453.     If Insform.Company <> "" And Insform.LastName <> "" Then 'If both Company and Lastname have data
  454.             Call InsertCompany                  'First call Subroutine to Insert the Company
  455.             
  456.             Set dbsrecClientMax = dbs.OpenRecordset("SELECT MAX(Sequence_Number) FROM Client") 'Get the new entry info by using the biggest sequence number
  457.             TempSeqNum = dbsrecClientMax.Fields(0)
  458.             Set dbsrecClientTemp = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client WHERE Sequence_Number=" & TempSeqNum)
  459.             ci = dbsrecClientTemp.Fields(0)
  460.             cn = dbsrecClientTemp.Fields(1)
  461.             rectype = dbsrecClientTemp.Fields(2)
  462.             ClientForm.ID = ci
  463.             
  464.             If rectype = 1 Then 'If it is a company
  465.                 Call InsertContact                  'Then call Subroutine to Insert the Contact
  466.             Else
  467.                 MsgBox ("Error to get the new Company Id. Company client is already created.")
  468.             End If
  469.     Else
  470.             MsgBox ("Last Name and Company are required fields.") 'Warn user that a name is required
  471.             Insform.LastName.SetFocus                   'Set focus in the Lastname field
  472.             Exit Sub
  473.     End If
  474. End If
  475.     dbsrecClient.Close
  476.     dbs.Close
  477.     'To get the new entry's info by using the sequence number and update the recordsets
  478.     Set dbs = OpenDatabase("", False, False, "ODBC;DSN=" & DSN & ";UID=" & UID & ";PWD=" & PWD & ";")
  479.     Set dbsrecClient = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client")
  480.     Set dbsrecClientMax = dbs.OpenRecordset("SELECT MAX(Sequence_Number) FROM Client")
  481.     TempSeqNum = dbsrecClientMax.Fields(0)
  482.     Set dbsrecClientTemp = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client WHERE Sequence_Number=" & TempSeqNum)
  483.     ci = dbsrecClientTemp.Fields(0)
  484.     cn = dbsrecClientTemp.Fields(1)
  485.     rectype = dbsrecClientTemp.Fields(2)
  486. dbsrecClientMax.Close
  487. dbsrecClientTemp.Close
  488. Persform.Show   'Display the Persform
  489. Unload Me       'Terminate this form
  490. End Sub
  491. Private Sub Command2_Click()  'Cancel
  492.     Persform.Show
  493.     Unload Me   'User chose Cancel, so Unload the form without doing anything
  494. End Sub
  495. Private Sub Command3_Click()  'Clear
  496.     Set ClientForm = Insform
  497.     Call ClearFields
  498.     Set ClientForm = Nothing
  499. End Sub
  500. Private Sub Form_Load()
  501.     Set ClientForm = Insform
  502.     Call ClearFields    'Clear all the fields
  503.     Set ClientForm = Nothing
  504.     If ClientInsertType = 1 Then        'If the user chose Company
  505.     'Setup the form
  506.         Insform.EntryType.Text = "Company"
  507.         Insform.ID.Enabled = True
  508.         Insform.Label16.Enabled = True
  509.         Insform.Mr.Enabled = False
  510.         Insform.FirstName.Enabled = False
  511.         Insform.Initial.Enabled = False
  512.         Insform.LastName.Enabled = False
  513.         Insform.Position.Enabled = False
  514.         Insform.Salutation.Enabled = False
  515.         Insform.Label1.Enabled = False
  516.         Insform.Label2.Enabled = False
  517.         Insform.Label3.Enabled = False
  518.         Insform.Label4.Enabled = False
  519.         Insform.Label5.Enabled = False
  520.         Insform.Label6.Enabled = False
  521.         Insform.Label7.Enabled = True
  522.         Insform.Label8.Enabled = True
  523.         Insform.Label9.Enabled = True
  524.         Insform.Label10.Enabled = True
  525.         Insform.Label11.Enabled = True
  526.         Insform.Label12.Enabled = True
  527.         Insform.Label13.Enabled = True
  528.         Insform.Label14.Enabled = True
  529.         Insform.Label15.Enabled = True
  530.         Insform.Company.Enabled = True
  531.         Insform.Dept.Enabled = True
  532.         Insform.Division.Enabled = True
  533.         Insform.Address1.Enabled = True
  534.         Insform.Address2.Enabled = True
  535.         Insform.City.Enabled = True
  536.         Insform.State.Enabled = True
  537.         Insform.Zip.Enabled = True
  538.         Insform.Country.Enabled = True
  539.         
  540.     ElseIf ClientInsertType = 2 Then    'If the user chose Contact of the current entry
  541.         If rectype = 2 Or rectype = 32 Then 'If Individual or Individual contact
  542.             Set ClientForm = Insform
  543.             Call Personfill(0)      'Fill out the pre-setup fields
  544.             Set ClientForm = Nothing
  545.             'Setup the form
  546.             Insform.EntryType.Text = "Individual Contact"
  547.             Insform.ID.Enabled = False
  548.             Insform.Label16.Enabled = False
  549.             Insform.ID.Text = ci
  550.             Insform.Mr.Enabled = True
  551.             Insform.FirstName.Enabled = True
  552.             Insform.Initial.Enabled = True
  553.             Insform.LastName.Enabled = True
  554.             Insform.Position.Enabled = True
  555.             Insform.Salutation.Enabled = True
  556.             Insform.Label1.Enabled = True
  557.             Insform.Label2.Enabled = True
  558.             Insform.Label3.Enabled = True
  559.             Insform.Label4.Enabled = True
  560.             Insform.Label5.Enabled = True
  561.             Insform.Label6.Enabled = True
  562.             Insform.Label7.Enabled = False
  563.             Insform.Label8.Enabled = False
  564.             Insform.Label9.Enabled = False
  565.             Insform.Label10.Enabled = False
  566.             Insform.Label11.Enabled = False
  567.             Insform.Label12.Enabled = False
  568.             Insform.Label13.Enabled = False
  569.             Insform.Label14.Enabled = False
  570.             Insform.Label15.Enabled = False
  571.             Insform.Company.Enabled = False
  572.             Insform.Dept.Enabled = False
  573.             Insform.Division.Enabled = False
  574.             Insform.Address1.Enabled = False
  575.             Insform.Address2.Enabled = False
  576.             Insform.City.Enabled = False
  577.             Insform.State.Enabled = False
  578.             Insform.Zip.Enabled = False
  579.             Insform.Country.Enabled = False
  580.             Insform.Mr.Text = ""
  581.             Insform.FirstName.Text = ""
  582.             Insform.Initial.Text = ""
  583.             Insform.LastName.Text = ""
  584.             Insform.Position.Text = ""
  585.             Insform.Salutation.Text = ""
  586.             
  587.         ElseIf rectype = 1 Or rectype = 31 Then 'If Company or Company Contact
  588.             Set ClientForm = Insform
  589.             Call Companyfill(0)     'Fill out the pre-setup fields
  590.             Set ClientForm = Nothing
  591.             'Setup the form
  592.             Insform.EntryType.Text = "Company Contact"
  593.             Insform.ID.Enabled = False
  594.             Insform.Label16.Enabled = False
  595.             Insform.ID.Text = ci
  596.             Insform.Mr.Enabled = True
  597.             Insform.FirstName.Enabled = True
  598.             Insform.Initial.Enabled = True
  599.             Insform.LastName.Enabled = True
  600.             Insform.Position.Enabled = True
  601.             Insform.Salutation.Enabled = True
  602.             Insform.Label1.Enabled = True
  603.             Insform.Label2.Enabled = True
  604.             Insform.Label3.Enabled = True
  605.             Insform.Label4.Enabled = True
  606.             Insform.Label5.Enabled = True
  607.             Insform.Label6.Enabled = True
  608.             Insform.Label7.Enabled = False
  609.             Insform.Label8.Enabled = False
  610.             Insform.Label9.Enabled = False
  611.             Insform.Label10.Enabled = False
  612.             Insform.Label11.Enabled = False
  613.             Insform.Label12.Enabled = False
  614.             Insform.Label13.Enabled = False
  615.             Insform.Label14.Enabled = False
  616.             Insform.Label15.Enabled = False
  617.             Insform.Company.Enabled = False
  618.             Insform.Dept.Enabled = False
  619.             Insform.Division.Enabled = False
  620.             Insform.Address1.Enabled = False
  621.             Insform.Address2.Enabled = False
  622.             Insform.City.Enabled = False
  623.             Insform.State.Enabled = False
  624.             Insform.Zip.Enabled = False
  625.             Insform.Country.Enabled = False
  626.         End If
  627.     ElseIf ClientInsertType = 3 Then    'If the user chose Individual
  628.             'Setup the form
  629.             Insform.EntryType.Text = "Individual"
  630.             Insform.ID.Enabled = True
  631.             Insform.Label16.Enabled = True
  632.             Insform.Mr.Enabled = True
  633.             Insform.FirstName.Enabled = True
  634.             Insform.Initial.Enabled = True
  635.             Insform.LastName.Enabled = True
  636.             Insform.Position.Enabled = True
  637.             Insform.Salutation.Enabled = True
  638.             Insform.Label1.Enabled = True
  639.             Insform.Label2.Enabled = True
  640.             Insform.Label3.Enabled = True
  641.             Insform.Label4.Enabled = True
  642.             Insform.Label5.Enabled = True
  643.             Insform.Label6.Enabled = True
  644.             Insform.Label7.Enabled = True
  645.             Insform.Label8.Enabled = True
  646.             Insform.Label9.Enabled = True
  647.             Insform.Label10.Enabled = True
  648.             Insform.Label11.Enabled = True
  649.             Insform.Label12.Enabled = True
  650.             Insform.Label13.Enabled = True
  651.             Insform.Label14.Enabled = True
  652.             Insform.Label15.Enabled = True
  653.             Insform.Company.Enabled = True
  654.             Insform.Dept.Enabled = True
  655.             Insform.Division.Enabled = True
  656.             Insform.Address1.Enabled = True
  657.             Insform.Address2.Enabled = True
  658.             Insform.City.Enabled = True
  659.             Insform.State.Enabled = True
  660.             Insform.Zip.Enabled = True
  661.             Insform.Country.Enabled = True
  662.     ElseIf ClientInsertType = 4 Then    'If the user chose Contact of new Company entry
  663.             'Setup the form
  664.             Insform.EntryType.Text = "Company and Contact"
  665.             Insform.ID.Enabled = True
  666.             Insform.Label16.Enabled = True
  667.             Insform.Mr.Enabled = True
  668.             Insform.FirstName.Enabled = True
  669.             Insform.Initial.Enabled = True
  670.             Insform.LastName.Enabled = True
  671.             Insform.Position.Enabled = True
  672.             Insform.Salutation.Enabled = True
  673.             Insform.Label1.Enabled = True
  674.             Insform.Label2.Enabled = True
  675.             Insform.Label3.Enabled = True
  676.             Insform.Label4.Enabled = True
  677.             Insform.Label5.Enabled = True
  678.             Insform.Label6.Enabled = True
  679.             Insform.Label7.Enabled = True
  680.             Insform.Label8.Enabled = True
  681.             Insform.Label9.Enabled = True
  682.             Insform.Label10.Enabled = True
  683.             Insform.Label11.Enabled = True
  684.             Insform.Label12.Enabled = True
  685.             Insform.Label13.Enabled = True
  686.             Insform.Label14.Enabled = True
  687.             Insform.Label15.Enabled = True
  688.             Insform.Company.Enabled = True
  689.             Insform.Dept.Enabled = True
  690.             Insform.Division.Enabled = True
  691.             Insform.Address1.Enabled = True
  692.             Insform.Address2.Enabled = True
  693.             Insform.City.Enabled = True
  694.             Insform.State.Enabled = True
  695.             Insform.Zip.Enabled = True
  696.             Insform.Country.Enabled = True
  697.     End If
  698.             
  699. End Sub
  700. Private Sub Mr_GotFocus()
  701. Call SelText(Insform.Mr, 40) 'Call function to Highlight text in this field.
  702. End Sub
  703. Private Sub FirstName_GotFocus()
  704. Call SelText(Insform.FirstName, 40) 'Call function to Highlight text in this field.
  705. End Sub
  706. Private Sub Initial_GotFocus()
  707. Call SelText(Insform.Initial, 2) 'Call function to Highlight text in this field.
  708. End Sub
  709. Private Sub LastName_GotFocus()
  710. Call SelText(Insform.LastName, 60) 'Call function to Highlight text in this field.
  711. End Sub
  712. Private Sub Position_GotFocus()
  713. Call SelText(Insform.Position, 60) 'Call function to Highlight text in this field.
  714. End Sub
  715. Private Sub Salutation_GotFocus()
  716. Call SelText(Insform.Salutation, 40) 'Call function to Highlight text in this field.
  717. End Sub
  718. Private Sub Company_GotFocus()
  719. Call SelText(Insform.Company, 60) 'Call function to Highlight text in this field.
  720. End Sub
  721. Private Sub Dept_GotFocus()
  722. Call SelText(Insform.Dept, 40) 'Call function to Highlight text in this field.
  723. End Sub
  724. Private Sub Division_GotFocus()
  725. Call SelText(Insform.Division, 40) 'Call function to Highlight text in this field.
  726. End Sub
  727. Private Sub Address1_GotFocus()
  728. Call SelText(Insform.Address1, 40) 'Call function to Highlight text in this field.
  729. End Sub
  730. Private Sub Address2_GotFocus()
  731. Call SelText(Insform.Address2, 40) 'Call function to Highlight text in this field.
  732. End Sub
  733. Private Sub City_GotFocus()
  734. Call SelText(Insform.City, 40) 'Call function to Highlight text in this field.
  735. End Sub
  736. Private Sub State_GotFocus()
  737. Call SelText(Insform.State, 40) 'Call function to Highlight text in this field.
  738. End Sub
  739. Private Sub Zip_GotFocus()
  740. Call SelText(Insform.Zip, 20) 'Call function to Highlight text in this field.
  741. End Sub
  742. Private Sub Country_GotFocus()
  743. Call SelText(Insform.Country, 40) 'Call function to Highlight text in this field.
  744. End Sub
  745. Private Sub Phone1_GotFocus()
  746. Call SelText(Insform.Phone1, 22) 'Call function to Highlight text in this field.
  747. End Sub
  748. Private Sub Phone2_GotFocus()
  749. Call SelText(Insform.Phone2, 22) 'Call function to Highlight text in this field.
  750. End Sub
  751. Private Sub Phone3_GotFocus()
  752. Call SelText(Insform.Phone3, 22) 'Call function to Highlight text in this field.
  753. End Sub
  754. Private Sub Phone4_GotFocus()
  755. Call SelText(Insform.Phone4, 22) 'Call function to Highlight text in this field.
  756. End Sub
  757. Private Sub Phone1Ext_GotFocus()
  758. Call SelText(Insform.Phone1Ext, 6) 'Call function to Highlight text in this field.
  759. End Sub
  760. Private Sub Phone2Ext_GotFocus()
  761. Call SelText(Insform.Phone2Ext, 6) 'Call function to Highlight text in this field.
  762. End Sub
  763. Private Sub Phone3Ext_GotFocus()
  764. Call SelText(Insform.Phone3Ext, 6) 'Call function to Highlight text in this field.
  765. End Sub
  766. Private Sub Phone4Ext_GotFocus()
  767. Call SelText(Insform.Phone4Ext, 6) 'Call function to Highlight text in this field.
  768. End Sub
  769.