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

  1. VERSION 4.00
  2. Begin VB.Form frmAddJobProject 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Add Titles to Project"
  5.    ClientHeight    =   3630
  6.    ClientLeft      =   2190
  7.    ClientTop       =   1500
  8.    ClientWidth     =   6585
  9.    ControlBox      =   0   'False
  10.    Height          =   4035
  11.    Left            =   2130
  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             =   1155
  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 dbaJobProject 
  30.       Caption         =   "JobProject"
  31.       Connect         =   "Access"
  32.       DatabaseName    =   "c:\sams\maketeam"
  33.       Exclusive       =   0   'False
  34.       Height          =   300
  35.       Left            =   0
  36.       Options         =   0
  37.       ReadOnly        =   0   'False
  38.       RecordsetType   =   1  'Dynaset
  39.       RecordSource    =   "qryJobProject"
  40.       Top             =   3330
  41.       Visible         =   0   'False
  42.       Width           =   2115
  43.    End
  44.    Begin VB.TextBox Text1 
  45.       BackColor       =   &H00808080&
  46.       Height          =   1725
  47.       Left            =   5130
  48.       Locked          =   -1  'True
  49.       MultiLine       =   -1  'True
  50.       TabIndex        =   2
  51.       TabStop         =   0   'False
  52.       Text            =   "AddJobPr.frx":0000
  53.       Top             =   1740
  54.       Width           =   1245
  55.    End
  56.    Begin VB.CommandButton cmdSave 
  57.       Caption         =   "&OK"
  58.       Height          =   465
  59.       Left            =   5130
  60.       TabIndex        =   0
  61.       Top             =   600
  62.       Width           =   1245
  63.    End
  64.    Begin VB.Data dbaJobtitle 
  65.       Caption         =   "Jobtitle"
  66.       Connect         =   "Access"
  67.       DatabaseName    =   "c:\sams\maketeam"
  68.       Exclusive       =   0   'False
  69.       Height          =   300
  70.       Left            =   2700
  71.       Options         =   0
  72.       ReadOnly        =   0   'False
  73.       RecordsetType   =   1  'Dynaset
  74.       RecordSource    =   "tblJobtitle"
  75.       Top             =   3330
  76.       Visible         =   0   'False
  77.       Width           =   2055
  78.    End
  79.    Begin MSDBCtls.DBList lstJobtitles 
  80.       Bindings        =   "AddJobPr.frx":0075
  81.       Height          =   3375
  82.       Left            =   870
  83.       TabIndex        =   1
  84.       Top             =   90
  85.       Width           =   3915
  86.       _Version        =   65536
  87.       _ExtentX        =   6906
  88.       _ExtentY        =   5953
  89.       _StockProps     =   77
  90.       ForeColor       =   -2147483640
  91.       BackColor       =   12632256
  92.       ListField       =   "Name"
  93.       BoundColumn     =   "JobtitleKey"
  94.    End
  95. Attribute VB_Name = "frmAddJobProject"
  96. Attribute VB_Creatable = False
  97. Attribute VB_Exposed = False
  98. Option Explicit
  99. Dim TitlesAdded As Integer
  100. Sub AddATitle()
  101.   If Len(Trim(lstJobtitles)) > 0 Then
  102.     dbaJobProject.Recordset.AddNew
  103.     dbaJobProject.Recordset![ProjectKey] = gProjectKey
  104.     dbaJobProject.Recordset![JobtitleKey] = lstJobtitles.BoundText
  105.     dbaJobProject.Recordset.UPDATE
  106.     TitlesAdded = TitlesAdded + 1 'Put screen updates here if you want to see status.
  107.   Else
  108.     MsgBox "Please highlight a title before trying to add it.", 64, gProgramTitle
  109.   End If
  110. End Sub
  111. Private Sub cmdSave_Click()
  112.   gAction = 0
  113.   Unload frmAddJobProject
  114. End Sub
  115. Private Sub cmdSelect_Click()
  116.   AddATitle
  117. End Sub
  118. Private Sub Form_Load()
  119.   Left = (Screen.Width - Width) / 2
  120.   TOP = (Screen.Height - Height) / 2
  121.   MousePointer = 0
  122.   TitlesAdded = 0
  123.   dbaJobtitle.DatabaseName = gMainDBName
  124.   dbaJobtitle.Refresh
  125.   dbaJobProject.DatabaseName = gMainDBName
  126.   dbaJobProject.Refresh
  127.   frmAddJobProject.Caption = "Add New Titles to Project"
  128. End Sub
  129. Private Sub lstJobtitles_DblClick()
  130.   AddATitle
  131. End Sub
  132.