home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap36 / main.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-19  |  63.3 KB  |  1,676 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Best Team Selector"
  5.    ClientHeight    =   6105
  6.    ClientLeft      =   1230
  7.    ClientTop       =   2280
  8.    ClientWidth     =   8670
  9.    Height          =   6795
  10.    Icon            =   "Main.frx":0000
  11.    Left            =   1170
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6105
  17.    ScaleWidth      =   8670
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   1650
  20.    Visible         =   0   'False
  21.    Width           =   8790
  22.    Begin VB.Data dbaCandidateProject 
  23.       Caption         =   "CandidateProject"
  24.       Connect         =   "Access"
  25.       DatabaseName    =   ""
  26.       Exclusive       =   0   'False
  27.       Height          =   300
  28.       Left            =   4290
  29.       Options         =   0
  30.       ReadOnly        =   0   'False
  31.       RecordsetType   =   1  'Dynaset
  32.       RecordSource    =   "qryCandidateProject"
  33.       Top             =   360
  34.       Visible         =   0   'False
  35.       Width           =   2145
  36.    End
  37.    Begin VB.Data dbaSkillJob 
  38.       Caption         =   "SkillJob"
  39.       Connect         =   "Access"
  40.       DatabaseName    =   ""
  41.       Exclusive       =   0   'False
  42.       Height          =   300
  43.       Left            =   4320
  44.       Options         =   0
  45.       ReadOnly        =   0   'False
  46.       RecordsetType   =   1  'Dynaset
  47.       RecordSource    =   "qrySkillJob"
  48.       Top             =   30
  49.       Visible         =   0   'False
  50.       Width           =   2145
  51.    End
  52.    Begin VB.Data dbaProject 
  53.       Caption         =   "Project"
  54.       Connect         =   "Access"
  55.       DatabaseName    =   ""
  56.       Exclusive       =   0   'False
  57.       Height          =   300
  58.       Left            =   6450
  59.       Options         =   0
  60.       ReadOnly        =   0   'False
  61.       RecordsetType   =   1  'Dynaset
  62.       RecordSource    =   "qryProject"
  63.       Top             =   330
  64.       Visible         =   0   'False
  65.       Width           =   2145
  66.    End
  67.    Begin VB.Data dbaJobtitle 
  68.       Caption         =   "Jobtitle"
  69.       Connect         =   "Access"
  70.       DatabaseName    =   ""
  71.       Exclusive       =   0   'False
  72.       Height          =   300
  73.       Left            =   2130
  74.       Options         =   0
  75.       ReadOnly        =   0   'False
  76.       RecordsetType   =   2  'Snapshot
  77.       RecordSource    =   "tblJobtitle"
  78.       Top             =   330
  79.       Visible         =   0   'False
  80.       Width           =   2145
  81.    End
  82.    Begin VB.Data dbaCandidateSkill 
  83.       Caption         =   "CandidateSkill"
  84.       Connect         =   "Access"
  85.       DatabaseName    =   ""
  86.       Exclusive       =   0   'False
  87.       Height          =   300
  88.       Left            =   0
  89.       Options         =   0
  90.       ReadOnly        =   0   'False
  91.       RecordsetType   =   1  'Dynaset
  92.       RecordSource    =   "qryCandidateSkillRating"
  93.       Top             =   330
  94.       Visible         =   0   'False
  95.       Width           =   2145
  96.    End
  97.    Begin VB.Data dbaJobProject 
  98.       Caption         =   "JobProject"
  99.       Connect         =   "Access"
  100.       DatabaseName    =   ""
  101.       Exclusive       =   0   'False
  102.       Height          =   300
  103.       Left            =   2130
  104.       Options         =   0
  105.       ReadOnly        =   0   'False
  106.       RecordsetType   =   1  'Dynaset
  107.       RecordSource    =   "qryJobProject"
  108.       Top             =   30
  109.       Visible         =   0   'False
  110.       Width           =   2145
  111.    End
  112.    Begin VB.Data dbaSkills 
  113.       Caption         =   "Skills "
  114.       Connect         =   "Access"
  115.       DatabaseName    =   ""
  116.       Exclusive       =   0   'False
  117.       Height          =   300
  118.       Left            =   0
  119.       Options         =   0
  120.       ReadOnly        =   0   'False
  121.       RecordsetType   =   1  'Dynaset
  122.       RecordSource    =   "qrySkill"
  123.       Top             =   30
  124.       Visible         =   0   'False
  125.       Width           =   2145
  126.    End
  127.    Begin MSComDlg.CommonDialog CMDialog1 
  128.       Left            =   -30
  129.       Top             =   720
  130.       _Version        =   65536
  131.       _ExtentX        =   847
  132.       _ExtentY        =   847
  133.       _StockProps     =   0
  134.    End
  135.    Begin TabDlg.SSTab tabMain 
  136.       Height          =   5805
  137.       Left            =   120
  138.       TabIndex        =   0
  139.       Top             =   180
  140.       Width           =   8415
  141.       _Version        =   65536
  142.       _ExtentX        =   14843
  143.       _ExtentY        =   10239
  144.       _StockProps     =   15
  145.       Caption         =   "Tea&m"
  146.       TabsPerRow      =   5
  147.       Tab             =   4
  148.       TabOrientation  =   1
  149.       Tabs            =   5
  150.       Style           =   0
  151.       TabMaxWidth     =   0
  152.       TabHeight       =   529
  153.       WordWrap        =   0   'False
  154.       TabCaption(0)   =   "&Candidates"
  155.       Tab(0).ControlCount=   1
  156.       Tab(0).ControlEnabled=   0   'False
  157.       Tab(0).Control(0)=   "Picture1"
  158.       TabCaption(1)   =   "&Skills"
  159.       Tab(1).ControlCount=   1
  160.       Tab(1).ControlEnabled=   0   'False
  161.       Tab(1).Control(0)=   "fmeSkills"
  162.       TabCaption(2)   =   "&Titles"
  163.       Tab(2).ControlCount=   1
  164.       Tab(2).ControlEnabled=   0   'False
  165.       Tab(2).Control(0)=   "fmeTitles"
  166.       TabCaption(3)   =   "&Projects"
  167.       Tab(3).ControlCount=   1
  168.       Tab(3).ControlEnabled=   0   'False
  169.       Tab(3).Control(0)=   "fmeProjects"
  170.       TabCaption(4)   =   "Tea&m"
  171.       Tab(4).ControlCount=   1
  172.       Tab(4).ControlEnabled=   -1  'True
  173.       Tab(4).Control(0)=   "fmeTeam"
  174.       Begin VB.Frame fmeProjects 
  175.          Height          =   5385
  176.          Left            =   -74910
  177.          TabIndex        =   69
  178.          Top             =   30
  179.          Width           =   8265
  180.          Begin VB.CommandButton cmdDelProject 
  181.             Caption         =   "Delete"
  182.             Height          =   495
  183.             Left            =   1320
  184.             TabIndex        =   77
  185.             Top             =   4710
  186.             Width           =   1485
  187.          End
  188.          Begin VB.CommandButton cmdEditProject 
  189.             Caption         =   "Ed&it"
  190.             Height          =   495
  191.             Left            =   2100
  192.             TabIndex        =   76
  193.             Top             =   4170
  194.             Width           =   1485
  195.          End
  196.          Begin VB.CommandButton cmdAddProject 
  197.             Caption         =   "&Add"
  198.             Height          =   495
  199.             Left            =   570
  200.             TabIndex        =   75
  201.             Top             =   4170
  202.             Width           =   1485
  203.          End
  204.          Begin VB.TextBox txtProjectKey 
  205.             BackColor       =   &H00FFFF00&
  206.             DataField       =   "ProjectKey"
  207.             DataSource      =   "dbaProject"
  208.             Height          =   315
  209.             Left            =   3690
  210.             TabIndex        =   74
  211.             Text            =   "-1"
  212.             Top             =   510
  213.             Visible         =   0   'False
  214.             Width           =   405
  215.          End
  216.          Begin VB.Frame fmeTitlesOfProject 
  217.             Caption         =   "Titles of Selected Project"
  218.             Height          =   4785
  219.             Left            =   4290
  220.             TabIndex        =   70
  221.             Top             =   420
  222.             Width           =   3585
  223.             Begin VB.CommandButton cmdDelJobProject 
  224.                Caption         =   "Remove"
  225.                Height          =   495
  226.                Left            =   1830
  227.                TabIndex        =   72
  228.                Top             =   4170
  229.                Width           =   1485
  230.             End
  231.             Begin VB.CommandButton cmdAddJobProject 
  232.                Caption         =   "Add"
  233.                Height          =   495
  234.                Left            =   300
  235.                TabIndex        =   71
  236.                Top             =   4170
  237.                Width           =   1485
  238.             End
  239.             Begin MSDBCtls.DBList lstJobProject 
  240.                Bindings        =   "Main.frx":030A
  241.                Height          =   3570
  242.                Left            =   300
  243.                TabIndex        =   73
  244.                Top             =   330
  245.                Width           =   3015
  246.                _Version        =   65536
  247.                _ExtentX        =   5318
  248.                _ExtentY        =   6297
  249.                _StockProps     =   77
  250.                ForeColor       =   -2147483640
  251.                BackColor       =   12632256
  252.                ListField       =   "tblJobtitle.Name"
  253.                BoundColumn     =   "JobProjectKey"
  254.             End
  255.          End
  256.          Begin MSDBCtls.DBList lstProject 
  257.             Bindings        =   "Main.frx":0320
  258.             Height          =   3570
  259.             Left            =   570
  260.             TabIndex        =   78
  261.             Top             =   510
  262.             Width           =   2985
  263.             _Version        =   65536
  264.             _ExtentX        =   5265
  265.             _ExtentY        =   6297
  266.             _StockProps     =   77
  267.             ForeColor       =   -2147483640
  268.             BackColor       =   12632256
  269.             ListField       =   "Name"
  270.             BoundColumn     =   "ProjectKey"
  271.          End
  272.       End
  273.       Begin VB.Frame fmeTitles 
  274.          Height          =   5385
  275.          Left            =   -74910
  276.          TabIndex        =   59
  277.          Top             =   30
  278.          Width           =   8265
  279.          Begin VB.Frame fmeSkillsOfTitle 
  280.             Caption         =   "Skills of Selected Title"
  281.             Height          =   4785
  282.             Left            =   4290
  283.             TabIndex        =   65
  284.             Top             =   420
  285.             Width           =   3585
  286.             Begin VB.CommandButton cmdAddJobSkills 
  287.                Caption         =   "Add"
  288.                Height          =   495
  289.                Left            =   300
  290.                TabIndex        =   67
  291.                Top             =   4170
  292.                Width           =   1485
  293.             End
  294.             Begin VB.CommandButton cmdDelJobSkills 
  295.                Caption         =   "Remove"
  296.                Height          =   495
  297.                Left            =   1830
  298.                TabIndex        =   66
  299.                Top             =   4170
  300.                Width           =   1485
  301.             End
  302.             Begin MSDBCtls.DBList lstSkillJob 
  303.                Bindings        =   "Main.frx":0333
  304.                Height          =   3570
  305.                Left            =   300
  306.                TabIndex        =   68
  307.                Top             =   330
  308.                Width           =   3015
  309.                _Version        =   65536
  310.                _ExtentX        =   5318
  311.                _ExtentY        =   6297
  312.                _StockProps     =   77
  313.                ForeColor       =   -2147483640
  314.                BackColor       =   12632256
  315.                ListField       =   "tblSkill.Name"
  316.                BoundColumn     =   "SkillJobKey"
  317.             End
  318.          End
  319.          Begin VB.TextBox txtJobtitleKey 
  320.             BackColor       =   &H00FFFF00&
  321.             DataField       =   "JobtitleKey"
  322.             DataSource      =   "dbaJobtitle"
  323.             Height          =   315
  324.             Left            =   3690
  325.             TabIndex        =   64
  326.             Text            =   "-1"
  327.             Top             =   510
  328.             Visible         =   0   'False
  329.             Width           =   405
  330.          End
  331.          Begin VB.CommandButton cmdAddTitle 
  332.             Caption         =   "&Add"
  333.             Height          =   495
  334.             Left            =   570
  335.             TabIndex        =   62
  336.             Top             =   4170
  337.             Width           =   1485
  338.          End
  339.          Begin VB.CommandButton cmdEditTitle 
  340.             Caption         =   "Ed&it"
  341.             Height          =   495
  342.             Left            =   2100
  343.             TabIndex        =   61
  344.             Top             =   4170
  345.             Width           =   1485
  346.          End
  347.          Begin VB.CommandButton cmdDelTitle 
  348.             Caption         =   "Delete"
  349.             Height          =   495
  350.             Left            =   1320
  351.             TabIndex        =   60
  352.             Top             =   4710
  353.             Width           =   1485
  354.          End
  355.          Begin MSDBCtls.DBList lstJobtitles 
  356.             Bindings        =   "Main.frx":0347
  357.             Height          =   3570
  358.             Left            =   570
  359.             TabIndex        =   63
  360.             Top             =   510
  361.             Width           =   2985
  362.             _Version        =   65536
  363.             _ExtentX        =   5265
  364.             _ExtentY        =   6297
  365.             _StockProps     =   77
  366.             ForeColor       =   -2147483640
  367.             BackColor       =   12632256
  368.             ListField       =   "Name"
  369.             BoundColumn     =   "JobtitleKey"
  370.          End
  371.       End
  372.       Begin VB.PictureBox Picture1 
  373.          BorderStyle     =   0  'None
  374.          Height          =   5385
  375.          Left            =   -74970
  376.          ScaleHeight     =   5385
  377.          ScaleWidth      =   8325
  378.          TabIndex        =   7
  379.          Top             =   30
  380.          Width           =   8325
  381.          Begin VB.CommandButton cmdDelCandidate 
  382.             Caption         =   "Delete Candidate"
  383.             Height          =   315
  384.             Left            =   6360
  385.             TabIndex        =   25
  386.             Top             =   4980
  387.             Width           =   1755
  388.          End
  389.          Begin VB.CommandButton cmdAddCandidate 
  390.             Caption         =   "&Add Candidate"
  391.             Height          =   315
  392.             Left            =   4500
  393.             TabIndex        =   24
  394.             Top             =   4980
  395.             Width           =   1755
  396.          End
  397.          Begin VB.Data dbaCandidate 
  398.             BackColor       =   &H00C0C0C0&
  399.             Caption         =   "Candidate Scroll"
  400.             Connect         =   "Access"
  401.             DatabaseName    =   ""
  402.             Exclusive       =   0   'False
  403.             Height          =   300
  404.             Left            =   1830
  405.             Options         =   0
  406.             ReadOnly        =   0   'False
  407.             RecordsetType   =   1  'Dynaset
  408.             RecordSource    =   "qryCandidate"
  409.             Top             =   4980
  410.             Width           =   2535
  411.          End
  412.          Begin TabDlg.SSTab tabCandidates 
  413.             Height          =   5055
  414.             Left            =   210
  415.             TabIndex        =   8
  416.             Top             =   180
  417.             Width           =   7935
  418.             _Version        =   65536
  419.             _ExtentX        =   13996
  420.             _ExtentY        =   8916
  421.             _StockProps     =   15
  422.             Caption         =   "Detail"
  423.             TabsPerRow      =   2
  424.             Tab             =   0
  425.             TabOrientation  =   1
  426.             Tabs            =   2
  427.             Style           =   1
  428.             TabMaxWidth     =   0
  429.             TabHeight       =   529
  430.             TabCaption(0)   =   "Detail"
  431.             Tab(0).ControlCount=   1
  432.             Tab(0).ControlEnabled=   -1  'True
  433.             Tab(0).Control(0)=   "Picture2"
  434.             TabCaption(1)   =   "Summary"
  435.             Tab(1).ControlCount=   1
  436.             Tab(1).ControlEnabled=   0   'False
  437.             Tab(1).Control(0)=   "Picture3"
  438.             Begin VB.PictureBox Picture3 
  439.                Height          =   4455
  440.                Left            =   -74940
  441.                ScaleHeight     =   4395
  442.                ScaleWidth      =   7695
  443.                TabIndex        =   52
  444.                Top             =   240
  445.                Width           =   7755
  446.                Begin MSDBCtls.DBList lstCandidate 
  447.                   Bindings        =   "Main.frx":035B
  448.                   Height          =   3885
  449.                   Left            =   450
  450.                   TabIndex        =   54
  451.                   Top             =   240
  452.                   Width           =   6675
  453.                   _Version        =   65536
  454.                   _ExtentX        =   11774
  455.                   _ExtentY        =   6853
  456.                   _StockProps     =   77
  457.                   ForeColor       =   -2147483640
  458.                   BackColor       =   12632256
  459.                   BeginProperty Font {FB8F0823-0164-101B-84ED-08002B2EC713} 
  460.                      name            =   "Courier New"
  461.                      charset         =   0
  462.                      weight          =   400
  463.                      size            =   9
  464.                      underline       =   0   'False
  465.                      italic          =   0   'False
  466.                      strikethrough   =   0   'False
  467.                   EndProperty
  468.                   ListField       =   "Combined"
  469.                   BoundColumn     =   "CandidateKey"
  470.                End
  471.             End
  472.             Begin VB.PictureBox Picture2 
  473.                BorderStyle     =   0  'None
  474.                Height          =   4575
  475.                Left            =   60
  476.                ScaleHeight     =   4575
  477.                ScaleWidth      =   7755
  478.                TabIndex        =   9
  479.                Top             =   150
  480.                Width           =   7755
  481.                Begin VB.TextBox txtCandidateKey 
  482.                   BackColor       =   &H00FFFF00&
  483.                   DataField       =   "CandidateKey"
  484.                   DataSource      =   "dbaCandidate"
  485.                   Height          =   315
  486.                   Left            =   1680
  487.                   TabIndex        =   80
  488.                   Text            =   "-1"
  489.                   Top             =   3780
  490.                   Visible         =   0   'False
  491.                   Width           =   735
  492.                End
  493.                Begin VB.PictureBox pctPicture 
  494.                   DataField       =   "Picture"
  495.                   DataSource      =   "dbaCandidate"
  496.                   Height          =   2655
  497.                   Left            =   30
  498.                   ScaleHeight     =   2595
  499.                   ScaleMode       =   0  'User
  500.                   ScaleWidth      =   2295
  501.                   TabIndex        =   41
  502.                   Top             =   360
  503.                   Width           =   2355
  504.                   Begin VB.Label lblNoPicture 
  505.                      Alignment       =   2  'Center
  506.                      Appearance      =   0  'Flat
  507.                      BackColor       =   &H00C0C0C0&
  508.                      Caption         =   "No Picture"
  509.                      BeginProperty Font 
  510.                         name            =   "MS Sans Serif"
  511.                         charset         =   0
  512.                         weight          =   700
  513.                         size            =   12
  514.                         underline       =   0   'False
  515.                         italic          =   0   'False
  516.                         strikethrough   =   0   'False
  517.                      EndProperty
  518.                      ForeColor       =   &H80000008&
  519.                      Height          =   735
  520.                      Left            =   540
  521.                      TabIndex        =   44
  522.                      Top             =   930
  523.                      Width           =   1095
  524.                   End
  525.                End
  526.                Begin VB.TextBox txtTitle 
  527.                   DataField       =   "Title"
  528.                   DataSource      =   "dbaCandidate"
  529.                   Height          =   285
  530.                   Left            =   60
  531.                   MaxLength       =   4
  532.                   TabIndex        =   16
  533.                   Top             =   4110
  534.                   Width           =   615
  535.                End
  536.                Begin VB.TextBox txtPhone 
  537.                   DataField       =   "Phone"
  538.                   DataSource      =   "dbaCandidate"
  539.                   Height          =   285
  540.                   Left            =   6390
  541.                   MaxLength       =   15
  542.                   TabIndex        =   15
  543.                   Top             =   4110
  544.                   Width           =   1215
  545.                End
  546.                Begin VB.TextBox Text3 
  547.                   DataField       =   "LastName"
  548.                   DataSource      =   "dbaCandidate"
  549.                   Height          =   285
  550.                   Left            =   3420
  551.                   MaxLength       =   25
  552.                   TabIndex        =   14
  553.                   Top             =   4110
  554.                   Width           =   2055
  555.                End
  556.                Begin VB.TextBox Text2 
  557.                   DataField       =   "MiddleInitial"
  558.                   DataSource      =   "dbaCandidate"
  559.                   Height          =   285
  560.                   Left            =   2940
  561.                   MaxLength       =   1
  562.                   TabIndex        =   13
  563.                   Top             =   4110
  564.                   Width           =   375
  565.                End
  566.                Begin VB.TextBox txtFirstName 
  567.                   DataField       =   "FirstName"
  568.                   DataSource      =   "dbaCandidate"
  569.                   Height          =   285
  570.                   Left            =   780
  571.                   MaxLength       =   20
  572.                   TabIndex        =   12
  573.                   Top             =   4110
  574.                   Width           =   2055
  575.                End
  576.                Begin VB.CheckBox chkAvailable 
  577.                   Caption         =   "A&vailable for New Projects"
  578.                   DataField       =   "Available"
  579.                   DataSource      =   "dbaCandidate"
  580.                   Height          =   375
  581.                   Left            =   90
  582.                   TabIndex        =   11
  583.                   Top             =   3150
  584.                   Width           =   2175
  585.                End
  586.                Begin VB.Frame fmeCandSkills 
  587.                   Caption         =   "Skills of Candidate"
  588.                   Height          =   3495
  589.                   Left            =   2460
  590.                   TabIndex        =   10
  591.                   Top             =   270
  592.                   Width           =   5265
  593.                   Begin TabDlg.SSTab tabCandidateSkill 
  594.                      Height          =   3225
  595.                      Left            =   60
  596.                      TabIndex        =   26
  597.                      Top             =   210
  598.                      Width           =   5115
  599.                      _Version        =   65536
  600.                      _ExtentX        =   9022
  601.                      _ExtentY        =   5689
  602.                      _StockProps     =   15
  603.                      Caption         =   "List"
  604.                      TabsPerRow      =   4
  605.                      Tab             =   0
  606.                      TabOrientation  =   0
  607.                      Tabs            =   4
  608.                      Style           =   0
  609.                      TabMaxWidth     =   0
  610.                      TabHeight       =   529
  611.                      TabCaption(0)   =   "List"
  612.                      Tab(0).ControlCount=   1
  613.                      Tab(0).ControlEnabled=   -1  'True
  614.                      Tab(0).Control(0)=   "picListCandidateSkill"
  615.                      TabCaption(1)   =   "Add"
  616.                      Tab(1).ControlCount=   1
  617.                      Tab(1).ControlEnabled=   0   'False
  618.                      Tab(1).Control(0)=   "picAddCandidateSkill"
  619.                      TabCaption(2)   =   "Edit"
  620.                      Tab(2).ControlCount=   1
  621.                      Tab(2).ControlEnabled=   0   'False
  622.                      Tab(2).Control(0)=   "picEditCandidateSkill"
  623.                      TabCaption(3)   =   "Delete"
  624.                      Tab(3).ControlCount=   1
  625.                      Tab(3).ControlEnabled=   0   'False
  626.                      Tab(3).Control(0)=   "picDelCandidateSkill"
  627.                      Begin VB.PictureBox picEditCandidateSkill 
  628.                         Height          =   2805
  629.                         Left            =   -74940
  630.                         ScaleHeight     =   2745
  631.                         ScaleWidth      =   4935
  632.                         TabIndex        =   45
  633.                         Top             =   360
  634.                         Width           =   4995
  635.                         Begin VB.TextBox txtEditSkill 
  636.                            BackColor       =   &H00C0C0C0&
  637.                            Height          =   285
  638.                            Left            =   1020
  639.                            Locked          =   -1  'True
  640.                            TabIndex        =   49
  641.                            Top             =   540
  642.                            Width           =   3675
  643.                         End
  644.                         Begin VB.TextBox txtEditRating 
  645.                            Alignment       =   1  'Right Justify
  646.                            BackColor       =   &H00FFFFFF&
  647.                            Height          =   285
  648.                            Left            =   1020
  649.                            MaxLength       =   2
  650.                            MultiLine       =   -1  'True
  651.                            TabIndex        =   48
  652.                            Top             =   1080
  653.                            Width           =   375
  654.                         End
  655.                         Begin VB.CommandButton cmdEditSave 
  656.                            Caption         =   "Save"
  657.                            Height          =   405
  658.                            Left            =   3060
  659.                            TabIndex        =   47
  660.                            Top             =   1650
  661.                            Width           =   1665
  662.                         End
  663.                         Begin VB.CommandButton cmdEditCancel 
  664.                            Caption         =   "Cancel"
  665.                            Height          =   405
  666.                            Left            =   3060
  667.                            TabIndex        =   46
  668.                            Top             =   2100
  669.                            Width           =   1665
  670.                         End
  671.                         Begin VB.Label Label6 
  672.                            Alignment       =   1  'Right Justify
  673.                            Caption         =   "Skill:"
  674.                            Height          =   315
  675.                            Left            =   300
  676.                            TabIndex        =   51
  677.                            Top             =   570
  678.                            Width           =   615
  679.                         End
  680.                         Begin VB.Label Label5 
  681.                            Alignment       =   1  'Right Justify
  682.                            Caption         =   "Rating:"
  683.                            Height          =   315
  684.                            Left            =   300
  685.                            TabIndex        =   50
  686.                            Top             =   1080
  687.                            Width           =   615
  688.                         End
  689.                      End
  690.                      Begin VB.PictureBox picDelCandidateSkill 
  691.                         Height          =   2805
  692.                         Left            =   -74940
  693.                         ScaleHeight     =   2745
  694.                         ScaleWidth      =   4935
  695.                         TabIndex        =   34
  696.                         Top             =   360
  697.                         Width           =   4995
  698.                         Begin VB.CommandButton cmdDelCancel 
  699.                            Caption         =   "Cancel"
  700.                            Height          =   405
  701.                            Left            =   3060
  702.                            TabIndex        =   38
  703.                            Top             =   2100
  704.                            Width           =   1665
  705.                         End
  706.                         Begin VB.CommandButton cmdDelDelete 
  707.                            Caption         =   "Delete"
  708.                            Height          =   405
  709.                            Left            =   3060
  710.                            TabIndex        =   37
  711.                            Top             =   1650
  712.                            Width           =   1665
  713.                         End
  714.                         Begin VB.TextBox txtDelRating 
  715.                            Alignment       =   1  'Right Justify
  716.                            BackColor       =   &H00C0C0C0&
  717.                            DataField       =   "Rating"
  718.                            DataSource      =   "dbaCandidateSkill"
  719.                            Height          =   285
  720.                            Left            =   1020
  721.                            MaxLength       =   2
  722.                            MultiLine       =   -1  'True
  723.                            TabIndex        =   36
  724.                            Top             =   1080
  725.                            Width           =   375
  726.                         End
  727.                         Begin VB.TextBox txtDelSkill 
  728.                            BackColor       =   &H00C0C0C0&
  729.                            DataField       =   "Name"
  730.                            DataSource      =   "dbaCandidateSkill"
  731.                            Height          =   285
  732.                            Left            =   1020
  733.                            TabIndex        =   35
  734.                            Top             =   540
  735.                            Width           =   3675
  736.                         End
  737.                         Begin VB.Label Label8 
  738.                            Alignment       =   1  'Right Justify
  739.                            Caption         =   "Rating:"
  740.                            Height          =   315
  741.                            Left            =   300
  742.                            TabIndex        =   40
  743.                            Top             =   1080
  744.                            Width           =   615
  745.                         End
  746.                         Begin VB.Label Label7 
  747.                            Alignment       =   1  'Right Justify
  748.                            Caption         =   "Skill:"
  749.                            Height          =   315
  750.                            Left            =   300
  751.                            TabIndex        =   39
  752.                            Top             =   570
  753.                            Width           =   615
  754.                         End
  755.                      End
  756.                      Begin VB.PictureBox picAddCandidateSkill 
  757.                         Height          =   2805
  758.                         Left            =   -74940
  759.                         ScaleHeight     =   2745
  760.                         ScaleWidth      =   4935
  761.                         TabIndex        =   28
  762.                         Top             =   360
  763.                         Width           =   4995
  764.                         Begin VB.TextBox txtAddRating 
  765.                            Height          =   285
  766.                            Left            =   1020
  767.                            MultiLine       =   -1  'True
  768.                            TabIndex        =   43
  769.                            Text            =   "Main.frx":0370
  770.                            Top             =   1080
  771.                            Width           =   385
  772.                         End
  773.                         Begin VB.CommandButton cmdAddCancel 
  774.                            Caption         =   "Cancel"
  775.                            Height          =   405
  776.                            Left            =   3060
  777.                            TabIndex        =   31
  778.                            Top             =   2100
  779.                            Width           =   1665
  780.                         End
  781.                         Begin VB.CommandButton cmdAddSave 
  782.                            Caption         =   "Save"
  783.                            Height          =   405
  784.                            Left            =   3060
  785.                            TabIndex        =   30
  786.                            Top             =   1650
  787.                            Width           =   1665
  788.                         End
  789.                         Begin VB.CommandButton cmdAddSaveAndStay 
  790.                            Caption         =   "Save && Sta&y"
  791.                            Height          =   405
  792.                            Left            =   3060
  793.                            TabIndex        =   29
  794.                            Top             =   1200
  795.                            Width           =   1665
  796.                         End
  797.                         Begin MSDBCtls.DBCombo cboAddSkill 
  798.                            Bindings        =   "Main.frx":0374
  799.                            Height          =   315
  800.                            Left            =   1020
  801.                            TabIndex        =   42
  802.                            Top             =   540
  803.                            Width           =   3735
  804.                            _Version        =   65536
  805.                            _ExtentX        =   6588
  806.                            _ExtentY        =   556
  807.                            _StockProps     =   77
  808.                            ForeColor       =   0
  809.                            BackColor       =   16777215
  810.                            ListField       =   "Name"
  811.                            BoundColumn     =   "SkillKey"
  812.                         End
  813.                         Begin VB.Label Label4 
  814.                            Alignment       =   1  'Right Justify
  815.                            Caption         =   "Rating:"
  816.                            Height          =   315
  817.                            Left            =   300
  818.                            TabIndex        =   33
  819.                            Top             =   1080
  820.                            Width           =   615
  821.                         End
  822.                         Begin VB.Label Label3 
  823.                            Alignment       =   1  'Right Justify
  824.                            Caption         =   "Skill:"
  825.                            Height          =   315
  826.                            Left            =   300
  827.                            TabIndex        =   32
  828.                            Top             =   570
  829.                            Width           =   615
  830.                         End
  831.                      End
  832.                      Begin VB.PictureBox picListCandidateSkill 
  833.                         Height          =   2805
  834.                         Left            =   60
  835.                         ScaleHeight     =   2745
  836.                         ScaleWidth      =   4935
  837.                         TabIndex        =   27
  838.                         Top             =   360
  839.                         Width           =   4995
  840.                         Begin MSDBCtls.DBList lstCandidateSkill 
  841.                            Bindings        =   "Main.frx":0386
  842.                            Height          =   2535
  843.                            Left            =   30
  844.                            TabIndex        =   53
  845.                            Top             =   120
  846.                            Width           =   4875
  847.                            _Version        =   65536
  848.                            _ExtentX        =   8599
  849.                            _ExtentY        =   4471
  850.                            _StockProps     =   77
  851.                            ForeColor       =   -2147483640
  852.                            BackColor       =   12632256
  853.                            BeginProperty Font {FB8F0823-0164-101B-84ED-08002B2EC713} 
  854.                               name            =   "Courier New"
  855.                               charset         =   0
  856.                               weight          =   400
  857.                               size            =   9
  858.                               underline       =   0   'False
  859.                               italic          =   0   'False
  860.                               strikethrough   =   0   'False
  861.                            EndProperty
  862.                            ListField       =   "Combined"
  863.                            BoundColumn     =   "CandidateSkillsKey"
  864.                         End
  865.                      End
  866.                   End
  867.                End
  868.                Begin VB.Label lblPhone 
  869.                   Caption         =   "Phone"
  870.                   Height          =   255
  871.                   Left            =   6390
  872.                   TabIndex        =   21
  873.                   Top             =   3870
  874.                   Width           =   615
  875.                End
  876.                Begin VB.Label lblLastName 
  877.                   Caption         =   "Last Name"
  878.                   Height          =   255
  879.                   Left            =   3420
  880.                   TabIndex        =   20
  881.                   Top             =   3870
  882.                   Width           =   855
  883.                End
  884.                Begin VB.Label lblInitial 
  885.                   Caption         =   "Initial"
  886.                   Height          =   255
  887.                   Left            =   2940
  888.                   TabIndex        =   19
  889.                   Top             =   3870
  890.                   Width           =   495
  891.                End
  892.                Begin VB.Label lblFirstName 
  893.                   Caption         =   "First Name"
  894.                   Height          =   255
  895.                   Left            =   780
  896.                   TabIndex        =   18
  897.                   Top             =   3870
  898.                   Width           =   855
  899.                End
  900.                Begin VB.Label lblTitle 
  901.                   Caption         =   "Title"
  902.                   Height          =   255
  903.                   Left            =   60
  904.                   TabIndex        =   17
  905.                   Top             =   3870
  906.                   Width           =   615
  907.                End
  908.             End
  909.          End
  910.       End
  911.       Begin VB.Frame fmeTeam 
  912.          Height          =   5385
  913.          Left            =   90
  914.          TabIndex        =   5
  915.          Top             =   30
  916.          Width           =   8265
  917.          Begin VB.CommandButton cmdDoIt 
  918.             Caption         =   "Select &Best Team"
  919.             Enabled         =   0   'False
  920.             Height          =   375
  921.             Left            =   6210
  922.             TabIndex        =   6
  923.             Top             =   240
  924.             Width           =   1935
  925.          End
  926.          Begin MSDBCtls.DBList lstTeams 
  927.             Bindings        =   "Main.frx":03A0
  928.             Height          =   4470
  929.             Left            =   120
  930.             TabIndex        =   79
  931.             Top             =   720
  932.             Width           =   8025
  933.             _Version        =   65536
  934.             _ExtentX        =   14155
  935.             _ExtentY        =   7885
  936.             _StockProps     =   77
  937.             ForeColor       =   -2147483640
  938.             BackColor       =   12632256
  939.             BeginProperty Font {FB8F0823-0164-101B-84ED-08002B2EC713} 
  940.                name            =   "Courier New"
  941.                charset         =   0
  942.                weight          =   400
  943.                size            =   8.25
  944.                underline       =   0   'False
  945.                italic          =   0   'False
  946.                strikethrough   =   0   'False
  947.             EndProperty
  948.             ListField       =   "Combined"
  949.             BoundColumn     =   "Combined"
  950.          End
  951.          Begin VB.Label Label1 
  952.             Caption         =   "&Project:"
  953.             Height          =   225
  954.             Left            =   150
  955.             TabIndex        =   23
  956.             Top             =   330
  957.             Width           =   585
  958.          End
  959.          Begin MSDBCtls.DBCombo cboProjectTeam 
  960.             Bindings        =   "Main.frx":03BC
  961.             Height          =   315
  962.             Left            =   810
  963.             TabIndex        =   22
  964.             Top             =   270
  965.             Width           =   3345
  966.             _Version        =   65536
  967.             _ExtentX        =   5900
  968.             _ExtentY        =   556
  969.             _StockProps     =   77
  970.             ForeColor       =   0
  971.             BackColor       =   16777215
  972.             ListField       =   "Name"
  973.             BoundColumn     =   "ProjectKey"
  974.          End
  975.       End
  976.       Begin VB.Frame fmeSkills 
  977.          Height          =   5385
  978.          Left            =   -74910
  979.          TabIndex        =   4
  980.          Top             =   30
  981.          Width           =   8265
  982.          Begin VB.CommandButton cmdDeleteSkill 
  983.             Caption         =   "Delete"
  984.             Height          =   495
  985.             Left            =   5370
  986.             TabIndex        =   58
  987.             Top             =   2970
  988.             Width           =   1485
  989.          End
  990.          Begin VB.CommandButton cmdEditSkill 
  991.             Caption         =   "Ed&it"
  992.             Height          =   495
  993.             Left            =   5370
  994.             TabIndex        =   57
  995.             Top             =   2400
  996.             Width           =   1485
  997.          End
  998.          Begin VB.CommandButton cmdAddSkill 
  999.             Caption         =   "&Add"
  1000.             Height          =   495
  1001.             Left            =   5370
  1002.             TabIndex        =   56
  1003.             Top             =   1830
  1004.             Width           =   1485
  1005.          End
  1006.          Begin MSDBCtls.DBList lstSkills 
  1007.             Bindings        =   "Main.frx":03CF
  1008.             Height          =   4155
  1009.             Left            =   1830
  1010.             TabIndex        =   55
  1011.             Top             =   690
  1012.             Width           =   3015
  1013.             _Version        =   65536
  1014.             _ExtentX        =   5318
  1015.             _ExtentY        =   7329
  1016.             _StockProps     =   77
  1017.             ForeColor       =   -2147483640
  1018.             BackColor       =   12632256
  1019.             ListField       =   "Name"
  1020.             BoundColumn     =   "SkillKey"
  1021.          End
  1022.       End
  1023.       Begin MSDBGrid.DBGrid DBGrid3 
  1024.          Bindings        =   "Main.frx":03E1
  1025.          Height          =   3735
  1026.          Left            =   -74280
  1027.          OleObjectBlob   =   "Main.frx":03F3
  1028.          TabIndex        =   3
  1029.          Top             =   480
  1030.          Width           =   6255
  1031.       End
  1032.       Begin MSDBGrid.DBGrid DBGrid2 
  1033.          Bindings        =   "Main.frx":0B1D
  1034.          Height          =   3855
  1035.          Left            =   -74280
  1036.          OleObjectBlob   =   "Main.frx":0B2F
  1037.          TabIndex        =   2
  1038.          Top             =   480
  1039.          Width           =   6375
  1040.       End
  1041.       Begin MSDBGrid.DBGrid grdTitles 
  1042.          Height          =   4215
  1043.          Left            =   -73560
  1044.          OleObjectBlob   =   "Main.frx":1259
  1045.          TabIndex        =   1
  1046.          Top             =   360
  1047.          Width           =   5175
  1048.       End
  1049.    End
  1050.    Begin VB.Menu file 
  1051.       Caption         =   "&File"
  1052.       Begin VB.Menu fileNew 
  1053.          Caption         =   "&New..."
  1054.       End
  1055.       Begin VB.Menu fileOpen 
  1056.          Caption         =   "&Open..."
  1057.       End
  1058.       Begin VB.Menu filedash1 
  1059.          Caption         =   "-"
  1060.       End
  1061.       Begin VB.Menu fileExit 
  1062.          Caption         =   "E&xit"
  1063.       End
  1064.    End
  1065.    Begin VB.Menu edit 
  1066.       Caption         =   "&Edit"
  1067.       Begin VB.Menu editCut 
  1068.          Caption         =   "Cu&t"
  1069.       End
  1070.       Begin VB.Menu editCopy 
  1071.          Caption         =   "&Copy"
  1072.       End
  1073.       Begin VB.Menu editPaste 
  1074.          Caption         =   "&Paste"
  1075.       End
  1076.       Begin VB.Menu editdash1 
  1077.          Caption         =   "-"
  1078.       End
  1079.       Begin VB.Menu editProperties 
  1080.          Caption         =   "Proper&ties..."
  1081.       End
  1082.    End
  1083.    Begin VB.Menu help 
  1084.       Caption         =   "&Help"
  1085.       Begin VB.Menu helpAbout 
  1086.          Caption         =   "&About..."
  1087.       End
  1088.    End
  1089. Attribute VB_Name = "frmMain"
  1090. Attribute VB_Creatable = False
  1091. Attribute VB_Exposed = False
  1092. Option Explicit
  1093. Dim ThisForm As Object
  1094. Dim frmMain_Loading As Boolean
  1095. Public Function formatMainForm() As Integer
  1096.   Dim s
  1097.   'Set the titlebar to the database title.
  1098.   frmMain.Caption = gProgramTitle
  1099.   s = SQLResultStr(gMainDB, "Subject", "tblAboutDatabase", "")
  1100.   If Len(s) > 0 Then
  1101.     frmMain.Caption = frmMain.Caption + " - " + s
  1102.   End If
  1103.   'Setup/Remove the picture box.
  1104.   s = SQLResultStr(gMainDB, "ShowPictures", "tblAboutDatabase", "")
  1105.   If s Then
  1106.     pctPicture.Visible = True
  1107.     chkAvailable.TOP = 3150
  1108.   Else
  1109.     pctPicture.Visible = False
  1110.     chkAvailable.TOP = 2000
  1111.   End If
  1112.   formatMainForm = 0
  1113. End Function
  1114. Function validateEditCandidateSkill() As Boolean
  1115.   Dim okay As Boolean
  1116.   okay = True
  1117.   If Val(txtEditRating) < 1 Or Val(txtEditRating) > 10 Then
  1118.     MsgBox "Valid rating values are from 1 to 10.  The best rating is 10, the worst is 1.", 64, gProgramTitle
  1119.     txtEditRating.SetFocus
  1120.     okay = False
  1121.   End If
  1122.   validateEditCandidateSkill = okay
  1123. End Function
  1124. Function validateAddCandidateSkill() As Boolean
  1125.   Dim okay As Boolean
  1126.   okay = True
  1127.   If IsNull(txtCandidateKey) Or txtCandidateKey = -1 Then
  1128.     okay = False
  1129.     MsgBox "No candidate exists.", 48, gProgramTitle
  1130.     Exit Function
  1131.   End If
  1132.   If Val(txtAddRating) < 1 Or Val(txtAddRating) > 10 Then
  1133.     MsgBox "Valid rating values are from 1 to 10.  The best rating is 10, the worst is 1.", 64, gProgramTitle
  1134.     txtAddRating.SetFocus
  1135.     okay = False
  1136.   Else
  1137.     If Len(Trim$(cboAddSkill.TEXT)) < 1 Then
  1138.       MsgBox "You need to select a skill.", 64, gProgramTitle
  1139.       cboAddSkill.SetFocus
  1140.       okay = False
  1141.     Else
  1142.       If Len(Trim$(SQLResultStr(gMainDB, "SkillKey", "tblCandidateSkill", "CandidateKey=" + txtCandidateKey + " and SkillKey=" + cboAddSkill.BoundText))) > 0 Then
  1143.         MsgBox "This candidate already has the selected skill.", 64, gProgramTitle
  1144.         cboAddSkill.SetFocus
  1145.         okay = False
  1146.       End If
  1147.     End If
  1148.   End If
  1149.   validateAddCandidateSkill = okay
  1150. End Function
  1151. Private Sub cboProjectTeam_Click(Area As Integer)
  1152.   If Len(Trim(cboProjectTeam.BoundText)) > 0 Then
  1153.     'Populate the grid.
  1154.     dbaCandidateProject.RecordSource = "Select * From qryCandidateProject Where ProjectKey=" + cboProjectTeam.BoundText
  1155.     cmdDoIt.Enabled = True
  1156.   Else
  1157.     'Clear the grid.
  1158.     dbaCandidateProject.RecordSource = "Select * From qryCandidateProject Where ProjectKey = -1"
  1159.     cmdDoIt.Enabled = False
  1160.   End If
  1161.   dbaCandidateProject.Refresh
  1162. End Sub
  1163. Private Sub cmdAddCancel_Click()
  1164.   dbaCandidateSkill.Refresh
  1165.   tabCandidateSkill.Tab = 0
  1166. End Sub
  1167. Private Sub cmdAddCandidate_Click()
  1168.   gAction = 1
  1169.   MousePointer = 11
  1170.   frmAddCandidate.Show 1
  1171.   dbaCandidate.Refresh
  1172. End Sub
  1173. Private Sub cmdAddJobProject_Click()
  1174.   If Len(Trim(lstProject)) > 0 Then
  1175.     MousePointer = 11
  1176.     gAction = 1
  1177.     gProjectKey = lstProject.BoundText
  1178.     frmAddJobProject.Show 1
  1179.     dbaJobProject.Refresh
  1180.   Else
  1181.     MsgBox "Please select a project first.", 64, gProgramTitle
  1182.   End If
  1183. End Sub
  1184. Private Sub cmdAddJobSkills_Click()
  1185.   If Len(Trim(lstJobtitles)) > 0 Then
  1186.     MousePointer = 11
  1187.     gAction = 1
  1188.     gJobtitleKey = lstJobtitles.BoundText
  1189.     frmAddJobSkill.Show 1
  1190.     dbaSkillJob.Refresh
  1191.   Else
  1192.     MsgBox "Please select a title first.", 64, gProgramTitle
  1193.   End If
  1194. End Sub
  1195. Private Sub cmdAddProject_Click()
  1196.   gAction = 1
  1197.   gJobtitleKey = -1
  1198.   MousePointer = 11
  1199.   frmAddProject.Show 1
  1200.   dbaProject.Refresh
  1201. End Sub
  1202. Private Sub cmdAddSave_Click()
  1203.   Dim okay As Boolean
  1204.   okay = validateAddCandidateSkill()
  1205.   If okay Then
  1206.     'Okay to save the record.
  1207.     dbaCandidateSkill.Recordset.AddNew
  1208.     dbaCandidateSkill.Recordset![CandidateKey] = txtCandidateKey
  1209.     dbaCandidateSkill.Recordset![SkillKey] = cboAddSkill.BoundText
  1210.     dbaCandidateSkill.Recordset![Rating] = txtAddRating
  1211.     dbaCandidateSkill.Recordset.UPDATE
  1212.     tabCandidateSkill.Tab = 0
  1213.   End If
  1214. End Sub
  1215. Private Sub cmdAddSaveAndStay_Click()
  1216.   Dim okay As Boolean
  1217.   okay = validateAddCandidateSkill()
  1218.   If okay Then
  1219.     'Okay to save the record.
  1220.     dbaCandidateSkill.Recordset.AddNew
  1221.     dbaCandidateSkill.Recordset![CandidateKey] = txtCandidateKey
  1222.     dbaCandidateSkill.Recordset![SkillKey] = cboAddSkill.BoundText
  1223.     dbaCandidateSkill.Recordset![Rating] = txtAddRating
  1224.     dbaCandidateSkill.Recordset.UPDATE
  1225.     dbaCandidateSkill.Recordset.AddNew
  1226.   End If
  1227. End Sub
  1228. Private Sub cmdAddSkill_Click()
  1229.   gAction = 1
  1230.   gSkillKey = -1
  1231.   MousePointer = 11
  1232.   frmAddSkill.Show 1
  1233.   dbaSkills.Refresh
  1234. End Sub
  1235. Private Sub cmdAddTitle_Click()
  1236.   gAction = 1
  1237.   gJobtitleKey = -1
  1238.   MousePointer = 11
  1239.   frmAddJobtitle.Show 1
  1240.   dbaJobtitle.Refresh
  1241. End Sub
  1242. Private Sub cmdDelCancel_Click()
  1243.   tabCandidateSkill.Tab = 0
  1244.   dbaCandidateSkill.UpdateControls
  1245. End Sub
  1246. Private Sub cmdDelCandidate_Click()
  1247.   Dim SQL
  1248.   'Delete records of candidate skills.
  1249.   SQL = "DELETE * FROM tblCandidateSkill WHERE CandidateKey=" + txtCandidateKey
  1250.   gMainDB.Execute SQL, dbFailOnError
  1251.   'Delete the Candidate.
  1252.   SQL = "DELETE * FROM tblCandidate WHERE CandidateKey=" + txtCandidateKey
  1253.   gMainDB.Execute SQL, dbFailOnError
  1254.   dbaCandidate.Refresh
  1255. End Sub
  1256. Private Sub cmdDelDelete_Click()
  1257.   dbaCandidateSkill.Recordset.DELETE
  1258.   tabCandidateSkill.Tab = 0
  1259. End Sub
  1260. Private Sub cmdDeleteSkill_Click()
  1261.   If Len(Trim(lstSkills)) > 0 Then
  1262.     'Do not delete if in use.
  1263.     If Len(Trim$(SQLResultStr(gMainDB, "SkillKey", "tblCandidateSkill", "SkillKey=" + lstSkills.BoundText))) > 0 Then
  1264.       MsgBox "This skill cannot be deleted because it is attributed to a candidate.", 64, gProgramTitle
  1265.       Exit Sub
  1266.     End If
  1267.     If Len(Trim$(SQLResultStr(gMainDB, "SkillKey", "tblSkillJob", "SkillKey=" + lstSkills.BoundText))) > 0 Then
  1268.       MsgBox "This skill cannot be deleted because it is attributed to a title.", 64, gProgramTitle
  1269.       Exit Sub
  1270.     End If
  1271.     'Delete the record.
  1272.     dbaSkills.Recordset.FindFirst "SkillKey=" + lstSkills.BoundText
  1273.     dbaSkills.Recordset.DELETE
  1274.     dbaSkills.Refresh
  1275.   Else
  1276.     MsgBox "Please select a skill first.", 64, gProgramTitle
  1277.   End If
  1278. End Sub
  1279. Private Sub cmdDelJobProject_Click()
  1280.   If Len(Trim(lstJobProject.BoundText)) > 0 Then
  1281.     'Delete the record.
  1282.     dbaJobProject.Recordset.FindFirst "JobProjectKey=" + lstJobProject.BoundText
  1283.     dbaJobProject.Recordset.DELETE
  1284.     dbaJobProject.Refresh
  1285.   Else
  1286.     MsgBox "You must select a title first.", 64, gProgramTitle
  1287.   End If
  1288. End Sub
  1289. Private Sub cmdDelJobSkills_Click()
  1290.   If Len(Trim(lstSkillJob.BoundText)) > 0 Then
  1291.     'Delete the record.
  1292.     dbaSkillJob.Recordset.FindFirst "SkillJobKey=" + lstSkillJob.BoundText
  1293.     dbaSkillJob.Recordset.DELETE
  1294.     dbaSkillJob.Refresh
  1295.   Else
  1296.     MsgBox "You must select a skill first.", 64, gProgramTitle
  1297.   End If
  1298. End Sub
  1299. Private Sub cmdDelProject_Click()
  1300.   Dim SQL
  1301.   If Len(Trim(lstProject)) > 0 Then
  1302.     'Delete the titles of the project first.
  1303.     SQL = "DELETE * FROM tblJobProject WHERE ProjectKey=" + lstProject.BoundText
  1304.     gMainDB.Execute SQL, dbFailOnError
  1305.     'Delete the Project.
  1306.     SQL = "DELETE * FROM tblProject WHERE ProjectKey=" + lstProject.BoundText
  1307.     gMainDB.Execute SQL, dbFailOnError
  1308.     dbaProject.Refresh
  1309.   Else
  1310.     MsgBox "You must highlight a project first.", 64, gProgramTitle
  1311.   End If
  1312. End Sub
  1313. Private Sub cmdDelTitle_Click()
  1314.   Dim SQL
  1315.   If Len(Trim(lstJobtitles)) > 0 Then
  1316.     'Do not delete if in use.
  1317.     If Len(Trim$(SQLResultStr(gMainDB, "JobtitleKey", "tblJobProject", "JobtitleKey=" + lstJobtitles.BoundText))) > 0 Then
  1318.       MsgBox "This title cannot be deleted because it is attributed to a project.", 64, gProgramTitle
  1319.       Exit Sub
  1320.     End If
  1321.     'Delete the skills of the Jobtitle first.
  1322.     SQL = "DELETE * FROM tblSkillJob WHERE JobtitleKey=" + lstJobtitles.BoundText
  1323.     gMainDB.Execute SQL, dbFailOnError
  1324.     'Delete the Jobtitle.
  1325.     SQL = "DELETE * FROM tblJobtitle WHERE JobtitleKey=" + lstJobtitles.BoundText
  1326.     gMainDB.Execute SQL, dbFailOnError
  1327.     dbaJobtitle.Refresh
  1328.   Else
  1329.     MsgBox "You must select a title first.", 64, gProgramTitle
  1330.   End If
  1331. End Sub
  1332. Private Sub cmdDoIt_Click()
  1333.   Dim SQL$, res%
  1334.   Dim msg, style
  1335.   MousePointer = 11
  1336.   'Initialize some global "constants"
  1337.   EmpsInPool = SQLResultCount(gMainDB, "tblCandidate", "[Available] = -1")
  1338.   JobsInProject = SQLResultCount(gMainDB, "tblJobProject", "[ProjectKey] = " + cboProjectTeam.BoundText)
  1339.   'Quick sanity check.
  1340.   If JobsInProject > EmpsInPool Then
  1341.     MousePointer = 0
  1342.     MsgBox "Cannot continue.  There aren't enough available employees to fill all the jobs in the project.  Make more employees available or reduce the number of jobs in the project.", 64, gProgramTitle
  1343.     Exit Sub
  1344.   End If
  1345.   'Make sure this is what the user wants to do!
  1346.   MousePointer = 0
  1347.   msg = "Delete current team and look for a new one?"
  1348.   style = vbYesNo + vbQuestion + vbDefaultButton2 ' Define buttons.
  1349.   res% = MsgBox(msg, style, gProgramTitle)
  1350.   If res% = vbNo Then  ' User chose NO.
  1351.     Exit Sub
  1352.   End If
  1353.   MousePointer = 11
  1354.   'Nuke the current team table.
  1355.   SQL$ = "DELETE FROM tblCandidateProject where ProjectKey<>-999"
  1356.   gMainDB.Execute SQL, dbFailOnError
  1357.   lstTeams.Refresh
  1358.   'Get the show on the road.
  1359.   cboProjectTeam.SetFocus
  1360.   cboProjectTeam.Refresh
  1361.   frmSettings.Show 1  'User can do damage if not modal.
  1362. End Sub
  1363. Private Sub cmdEditCancel_Click()
  1364.   dbaCandidateSkill.UpdateControls
  1365.   tabCandidateSkill.Tab = 0
  1366. End Sub
  1367. Private Sub cmdEditProject_Click()
  1368.   gAction = 2
  1369.   gProjectKey = lstProject.BoundText
  1370.   If Not IsNull(lstProject) And Len(Trim$(lstProject)) > 0 Then
  1371.     MousePointer = 11
  1372.     frmAddProject.Show 1
  1373.     dbaProject.Refresh
  1374.   Else
  1375.     MsgBox "No project is selected to be edited.", 64, gProgramTitle
  1376.   End If
  1377. End Sub
  1378. Private Sub cmdEditSave_Click()
  1379.   Dim okay As Boolean
  1380.   okay = validateEditCandidateSkill()
  1381.   If okay Then
  1382.     'Okay to save the record.
  1383.     dbaCandidateSkill.Recordset.Edit
  1384.     dbaCandidateSkill.Recordset![Rating] = txtEditRating
  1385.     dbaCandidateSkill.Recordset.UPDATE
  1386.     tabCandidateSkill.Tab = 0
  1387.   End If
  1388. End Sub
  1389. Private Sub cmdEditSkill_Click()
  1390.   gAction = 2
  1391.   gSkillKey = lstSkills.BoundText
  1392.   If Not IsNull(lstSkills) And Len(Trim$(lstSkills)) > 0 Then
  1393.     MousePointer = 11
  1394.     frmAddSkill.Show 1
  1395.     dbaSkills.Refresh
  1396.   Else
  1397.     MsgBox "No skill is selected to be edited.", 64, gProgramTitle
  1398.   End If
  1399. End Sub
  1400. Private Sub cmdEditTitle_Click()
  1401.   gAction = 2
  1402.   gJobtitleKey = lstJobtitles.BoundText
  1403.   If Not IsNull(lstJobtitles) And Len(Trim$(lstJobtitles)) > 0 Then
  1404.     MousePointer = 11
  1405.     frmAddJobtitle.Show 1
  1406.     dbaJobtitle.Refresh
  1407.   Else
  1408.     MsgBox "No title is selected to be edited.", 64, gProgramTitle
  1409.   End If
  1410. End Sub
  1411. Private Sub dbaCandidate_Reposition()
  1412.   lstCandidate.BoundText = txtCandidateKey
  1413. End Sub
  1414. Private Sub fileExit_Click()
  1415.   End
  1416. End Sub
  1417. Private Sub fileNew_Click()
  1418.   MousePointer = 11
  1419.   frmCreateDB.Show 1
  1420. End Sub
  1421. Private Sub fileOpen_Click()
  1422.   Dim r%, gn$
  1423.   CMDialog1.Filter = "BTS Database|*.MDB"
  1424.   CMDialog1.FilterIndex = 1
  1425.   CMDialog1.filename = ""
  1426.   CMDialog1.CancelError = True
  1427.   On Error Resume Next
  1428.   Err = 0
  1429.   CMDialog1.Action = 1
  1430.   gn$ = UCase$(Trim$(CMDialog1.filename))
  1431.   If Err = 0 And gn$ > "" And (InStr(gn$, "*") = 0) And (InStr(gn$, "?") = 0) Then
  1432.     'Load the selected database.
  1433.     If Not SetDatabase(gn$) Then
  1434.       Beep
  1435.       MsgBox "Fatal Error: cannot open " + gn$ + ".  You may be missing files.", 16, gProgramTitle
  1436.       End
  1437.     End If
  1438.     r = formatMainForm()
  1439.   End If
  1440. End Sub
  1441. Private Sub Form_Activate()
  1442.   Dim r, SQL$
  1443.   r = formatMainForm()
  1444.   MousePointer = 0
  1445.   If frmMain_Loading Then
  1446.     frmMain_Loading = False
  1447.     'Nuke the current team table.
  1448.     SQL$ = "DELETE FROM tblCandidateProject where ProjectKey<>-999"
  1449.     gMainDB.Execute SQL, dbFailOnError
  1450.     Unload frmSplash
  1451.   End If
  1452. End Sub
  1453. Private Sub editCopy_Click()
  1454.   Clipboard.Clear
  1455.   If TypeOf Screen.ActiveControl Is TextBox Then
  1456.     Clipboard.SetText Screen.ActiveControl.SelText
  1457.   ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
  1458.     Clipboard.SetText Screen.ActiveControl.TEXT
  1459.   ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
  1460.     Clipboard.SetData Screen.ActiveControl.picture
  1461.   ElseIf TypeOf Screen.ActiveControl Is ListBox Then
  1462.     Clipboard.SetText Screen.ActiveControl.TEXT
  1463.   Else
  1464.     ' No action makes sense for the other controls.
  1465.   End If
  1466. End Sub
  1467. Private Sub editCut_Click()
  1468.   ' First do the same as a copy.
  1469.   editCopy_Click
  1470.   ' Now clear contents of active control.
  1471.   If TypeOf Screen.ActiveControl Is TextBox Then
  1472.     Screen.ActiveControl.SelText = ""
  1473.   ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
  1474.     Screen.ActiveControl.TEXT = ""
  1475.   ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
  1476.     Screen.ActiveControl.picture = LoadPicture()
  1477.   ElseIf TypeOf Screen.ActiveControl Is ListBox Then
  1478.     Screen.ActiveControl.RemoveItem Screen.ActiveControl.ListIndex
  1479.   Else
  1480.     ' No action makes sense for the other controls.
  1481.   End If
  1482. End Sub
  1483. Private Sub editPaste_Click()
  1484.   If TypeOf Screen.ActiveControl Is TextBox Then
  1485.     Screen.ActiveControl.SelText = Clipboard.GetText()
  1486.   ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
  1487.     Screen.ActiveControl.TEXT = Clipboard.GetText()
  1488.   ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
  1489.     Screen.ActiveControl.picture = Clipboard.GetData()
  1490.   ElseIf TypeOf Screen.ActiveControl Is ListBox Then
  1491.     Screen.ActiveControl.AddItem Clipboard.GetText()
  1492.   Else
  1493.     ' No action makes sense for the other controls.
  1494.   End If
  1495. End Sub
  1496. Private Sub Form_Initialize()
  1497.   Dim r
  1498.   Left = (Screen.Width - Width) / 2
  1499.   TOP = (Screen.Height - Height) / 2
  1500.   frmMain_Loading = True  'Flag for the activate.
  1501.   'Load the default database.
  1502.   If Not SetDatabase(App.Path + "\MAKETEAM.MDB") Then
  1503.     Beep
  1504.     MsgBox "Fatal Error: Cannot find the default database.  You may be missing files.", 16, gProgramTitle
  1505.     End
  1506.   End If
  1507.   'Set some configuration items.
  1508.   gDefaultRating = 5
  1509.   Set ThisForm = Me
  1510. End Sub
  1511. '---------------------------------------------------------
  1512. 'Open the selected database.  Returns FALSE if error.
  1513. '---------------------------------------------------------
  1514. Public Function SetDatabase(AP As String) As Boolean
  1515.   On Error GoTo SetDatabase_SomethingBad
  1516.   'Open main database.
  1517.   gMainDBName = AP
  1518.   Set gMainDB = Workspaces(0).OpenDatabase(gMainDBName)
  1519.   'Adjust the data controls to proper path.
  1520.   dbaCandidate.DatabaseName = gMainDBName
  1521.   dbaCandidateSkill.DatabaseName = gMainDBName
  1522.   dbaSkills.DatabaseName = gMainDBName
  1523.   dbaJobProject.DatabaseName = gMainDBName
  1524.   dbaProject.DatabaseName = gMainDBName
  1525.   dbaJobtitle.DatabaseName = gMainDBName
  1526.   dbaCandidateProject.DatabaseName = gMainDBName
  1527.   dbaSkillJob.DatabaseName = gMainDBName
  1528.   'Refresh all the controls.
  1529.   dbaCandidate.Refresh
  1530.   dbaCandidateSkill.Refresh
  1531.   dbaSkills.Refresh
  1532.   dbaJobProject.Refresh
  1533.   dbaProject.Refresh
  1534.   dbaJobtitle.Refresh
  1535.   dbaCandidateProject.Refresh
  1536.   dbaSkillJob.Refresh
  1537.   SetDatabase = True  'Successful.
  1538.   Exit Function
  1539. SetDatabase_SomethingBad:
  1540.   SetDatabase = False 'Unsuccessful.
  1541. End Function
  1542. Private Sub frmSkillsOfTitle_DragDrop(Source As Control, X As Single, Y As Single)
  1543. End Sub
  1544. Private Sub helpAbout_Click()
  1545.   frmAbout.Show 1
  1546. End Sub
  1547. Private Sub lstCandidate_Click()
  1548.   tabCandidates.Tab = 0
  1549.   tabCandidates_Click 0
  1550. End Sub
  1551. Private Sub lstJobtitles_Click()
  1552.   Dim thekey
  1553.   thekey = lstJobtitles.BoundText
  1554.   If Not IsNull(thekey) And Len(Trim$(thekey)) > 0 Then
  1555.     dbaJobtitle.Recordset.FindFirst "JobtitleKey=" + Str$(thekey)
  1556.   End If
  1557. End Sub
  1558. Private Sub lstProject_Click()
  1559.   Dim thekey
  1560.   thekey = lstProject.BoundText
  1561.   If Not IsNull(thekey) And Len(Trim$(thekey)) > 0 Then
  1562.     dbaProject.Recordset.FindFirst "ProjectKey=" + Str$(thekey)
  1563.   End If
  1564. End Sub
  1565. Private Sub pctPicture_Change()
  1566.   If pctPicture = Null Then
  1567.     lblNoPicture.Visible = True
  1568.   Else
  1569.     lblNoPicture.Visible = False
  1570.   End If
  1571. End Sub
  1572. Private Sub editProperties_Click()
  1573.   Dim r As Integer
  1574.   MousePointer = 11
  1575.   frmDBProperties.Show 1
  1576.   r = formatMainForm()
  1577. End Sub
  1578. Private Sub tabCandidates_Click(PreviousTab As Integer)
  1579.   Dim thekey
  1580.   thekey = lstCandidate.BoundText
  1581.   Select Case tabCandidates.Tab
  1582.   Case 0  'Detail Tab Page
  1583.     If PreviousTab = 1 Then
  1584.       'We were on the summary screen.
  1585.       'Get the current record.
  1586.       If Not IsNull(thekey) And Len(Trim$(thekey)) > 0 Then
  1587.         dbaCandidate.Recordset.FindFirst "CandidateKey=" + Str$(thekey)
  1588.       End If
  1589.     End If
  1590.   Case 1  'Summary Tab Page
  1591.     'Update summary screen.
  1592.     dbaCandidate.Recordset.Edit
  1593.     dbaCandidate.Recordset.UPDATE 'Record
  1594.     dbaCandidate.Recordset.Requery
  1595.   End Select
  1596. End Sub
  1597. Private Sub tabCandidateSkill_Click(PreviousTab As Integer)
  1598.   Dim thekey
  1599.   thekey = lstCandidateSkill.BoundText
  1600.   Select Case tabCandidateSkill.Tab
  1601.   Case 0
  1602.     'List
  1603.     If Len(CStr(txtCandidateKey)) > 0 Then
  1604.       If txtCandidateKey > -1 Then 'Flag that no candidate is selected.
  1605.         'We have a candidate so list his/her skills.
  1606.         On Error Resume Next
  1607.         dbaCandidateSkill.RecordSource = "Select * From qryCandidateSkillRating Where CandidateKey=" + txtCandidateKey
  1608.         dbaCandidateSkill.Recordset.Requery
  1609.         dbaCandidateSkill.UpdateControls
  1610.         lstCandidateSkill.Refresh     'Due to Beta6 trouble.
  1611.         dbaCandidateSkill.Refresh     'Due to Beta6 trouble.
  1612.       End If
  1613.     End If
  1614.   Case 1  'Add
  1615.     'Add
  1616.     cboAddSkill = ""
  1617.     txtAddRating = gDefaultRating
  1618.   Case 2  'Edit
  1619.     'Get the current record.
  1620.     If IsNull(thekey) Or Len(Trim$(thekey)) < 1 Then
  1621.       MsgBox "No candidate skill is selected.", 64, gProgramTitle
  1622.       tabCandidateSkill.Tab = 0
  1623.     Else
  1624.       dbaCandidateSkill.Recordset.FindFirst "CandidateSkillsKey=" + Str$(thekey)
  1625.       txtEditSkill = dbaCandidateSkill.Recordset![Name]
  1626.       txtEditRating = dbaCandidateSkill.Recordset![Rating]
  1627.     End If
  1628.   Case 3
  1629.     'Delete
  1630.     If IsNull(thekey) Or Len(Trim$(thekey)) < 1 Then
  1631.       MsgBox "No candidate skill is selected.", 64, gProgramTitle
  1632.       tabCandidateSkill.Tab = 0
  1633.     Else
  1634.       dbaCandidateSkill.Recordset.FindFirst "CandidateSkillsKey=" + Str$(thekey)
  1635.     End If
  1636.   End Select
  1637. End Sub
  1638. Private Sub tabMain_Click(PreviousTab As Integer)
  1639.   If PreviousTab = 0 Then
  1640.     'Save the displayed record in case changed.
  1641.     dbaCandidate.Recordset.Edit
  1642.     dbaCandidate.Recordset.UPDATE
  1643.   End If
  1644. End Sub
  1645. Private Sub txtCandidateKey_Change()
  1646.   tabCandidateSkill.Tab = 0
  1647.   tabCandidateSkill_Click 0
  1648. End Sub
  1649. Private Sub txtJobtitleKey_Change()
  1650.   If txtJobtitleKey > -1 Then
  1651.     If Len(Trim(lstJobtitles)) > 0 Then
  1652.       'Show skills for the selected title.
  1653.       dbaSkillJob.RecordSource = "Select * From qrySkillJob where JobtitleKey=" + lstJobtitles.BoundText
  1654.     Else
  1655.       'Blank out the list.
  1656.       dbaSkillJob.RecordSource = "Select * From qrySkillJob where JobtitleKey=-999"
  1657.     End If
  1658.     dbaSkillJob.Refresh
  1659.   End If
  1660. End Sub
  1661. Private Sub txtProjectKey_Change()
  1662.   If Len(CStr(txtProjectKey)) > 0 Then  'Empty case.
  1663.     If txtProjectKey > -1 Then
  1664.       If Len(Trim(lstProject)) > 0 Then
  1665.         'Show skills for the selected title.
  1666.         dbaJobProject.RecordSource = "select * from qryJobProject where ProjectKey=" + lstProject.BoundText
  1667.         dbaJobProject.Refresh
  1668.         Exit Sub
  1669.       End If
  1670.     End If
  1671.   End If
  1672.   'Blank out the list.
  1673.   dbaJobProject.RecordSource = "select * from qryJobProject where ProjectKey=-999"
  1674.   dbaJobProject.Refresh
  1675. End Sub
  1676.