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

  1. VERSION 4.00
  2. Begin VB.Form frmAddJobSkill 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Add Skills to Title"
  5.    ClientHeight    =   3630
  6.    ClientLeft      =   2655
  7.    ClientTop       =   2955
  8.    ClientWidth     =   6585
  9.    ControlBox      =   0   'False
  10.    Height          =   4035
  11.    Left            =   2595
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3630
  17.    ScaleWidth      =   6585
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   2610
  20.    Width           =   6705
  21.    Begin VB.CommandButton cmdSelect 
  22.       Caption         =   "&Select"
  23.       Height          =   465
  24.       Left            =   5130
  25.       TabIndex        =   3
  26.       Top             =   90
  27.       Width           =   1245
  28.    End
  29.    Begin VB.Data dbaSkillJob 
  30.       Caption         =   "dbaSkillJob"
  31.       Connect         =   "Access"
  32.       DatabaseName    =   "maketeam"
  33.       Exclusive       =   0   'False
  34.       Height          =   300
  35.       Left            =   0
  36.       Options         =   0
  37.       ReadOnly        =   0   'False
  38.       RecordsetType   =   1  'Dynaset
  39.       RecordSource    =   "tblSkillJob"
  40.       Top             =   3330
  41.       Visible         =   0   'False
  42.       Width           =   2115
  43.    End
  44.    Begin VB.TextBox Text1 
  45.       BackColor       =   &H00808080&
  46.       DataSource      =   "&H00808080&"
  47.       Height          =   1485
  48.       Left            =   5130
  49.       Locked          =   -1  'True
  50.       MultiLine       =   -1  'True
  51.       TabIndex        =   2
  52.       TabStop         =   0   'False
  53.       Text            =   "AddJobSk.frx":0000
  54.       Top             =   1980
  55.       Width           =   1245
  56.    End
  57.    Begin VB.CommandButton cmdSave 
  58.       Caption         =   "&OK"
  59.       Height          =   465
  60.       Left            =   5130
  61.       TabIndex        =   0
  62.       Top             =   600
  63.       Width           =   1245
  64.    End
  65.    Begin VB.Data dbaSkill 
  66.       Caption         =   "Skill"
  67.       Connect         =   "Access"
  68.       DatabaseName    =   "maketeam"
  69.       Exclusive       =   0   'False
  70.       Height          =   300
  71.       Left            =   2700
  72.       Options         =   0
  73.       ReadOnly        =   0   'False
  74.       RecordsetType   =   1  'Dynaset
  75.       RecordSource    =   "qrySkill"
  76.       Top             =   3330
  77.       Visible         =   0   'False
  78.       Width           =   1695
  79.    End
  80.    Begin MSDBCtls.DBList lstSkills 
  81.       Bindings        =   "AddJobSk.frx":0073
  82.       Height          =   3375
  83.       Left            =   870
  84.       TabIndex        =   1
  85.       Top             =   90
  86.       Width           =   3915
  87.       _Version        =   65536
  88.       _ExtentX        =   6906
  89.       _ExtentY        =   5953
  90.       _StockProps     =   77
  91.       ForeColor       =   -2147483640
  92.       BackColor       =   12632256
  93.       ListField       =   "Name"
  94.       BoundColumn     =   "SkillKey"
  95.    End
  96. Attribute VB_Name = "frmAddJobSkill"
  97. Attribute VB_Creatable = False
  98. Attribute VB_Exposed = False
  99. Option Explicit
  100. Dim SkillsAdded As Integer
  101. Sub AddASkill()
  102.   If Len(Trim(lstSkills)) > 0 Then
  103.     If Len(Trim$(SQLResultStr(gMainDB, "SkillKey", "tblSkillJob", _
  104.        "SkillKey=" + lstSkills.BoundText + " and " + _
  105.        "JobtitleKey=" + gJobtitleKey))) > 0 Then
  106.       MsgBox "This skill is already attributed to the selected title.", 64, gProgramTitle
  107.     Else
  108.       dbaSkillJob.Recordset.AddNew
  109.       dbaSkillJob.Recordset![JobtitleKey] = gJobtitleKey
  110.       dbaSkillJob.Recordset![SkillKey] = lstSkills.BoundText
  111.       dbaSkillJob.Recordset.UPDATE
  112.     End If
  113.     SkillsAdded = SkillsAdded + 1 'Put screen updates here if you want to see status.
  114.   Else
  115.     MsgBox "Please highlight a skill before trying to add it.", 64, gProgramTitle
  116.   End If
  117. End Sub
  118. Private Sub cmdCancel_Click()
  119.   gAction = -1
  120.   Unload frmAddJobSkill
  121. End Sub
  122. Private Sub cmdSave_Click()
  123.   gAction = 0
  124.   Unload frmAddJobSkill
  125. End Sub
  126. Private Sub cmdSelect_Click()
  127.   AddASkill
  128. End Sub
  129. Private Sub Form_Load()
  130.   Left = (Screen.Width - Width) / 2
  131.   TOP = (Screen.Height - Height) / 2
  132.   MousePointer = 0
  133.   SkillsAdded = 0
  134.   dbaSkill.DatabaseName = gMainDBName
  135.   dbaSkill.Refresh
  136.   dbaSkillJob.DatabaseName = gMainDBName
  137.   dbaSkillJob.Refresh
  138.   frmAddJobSkill.Caption = "Add New Skill to Title"
  139. End Sub
  140. Private Sub lstSkills_DblClick()
  141.   AddASkill
  142. End Sub
  143.