home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap36 / addskill.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-03  |  3.2 KB  |  116 lines

  1. VERSION 4.00
  2. Begin VB.Form frmAddSkill 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Add Skill"
  5.    ClientHeight    =   3690
  6.    ClientLeft      =   1710
  7.    ClientTop       =   1275
  8.    ClientWidth     =   6585
  9.    ControlBox      =   0   'False
  10.    Height          =   4095
  11.    Left            =   1650
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3690
  17.    ScaleWidth      =   6585
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   930
  20.    Width           =   6705
  21.    Begin VB.CommandButton cmdCancel 
  22.       Caption         =   "&Cancel"
  23.       Height          =   465
  24.       Left            =   5130
  25.       TabIndex        =   3
  26.       Top             =   600
  27.       Width           =   1245
  28.    End
  29.    Begin VB.CommandButton cmdSave 
  30.       Caption         =   "&Save"
  31.       Height          =   465
  32.       Left            =   5130
  33.       TabIndex        =   2
  34.       Top             =   90
  35.       Width           =   1245
  36.    End
  37.    Begin VB.TextBox txtName 
  38.       Height          =   285
  39.       Left            =   210
  40.       TabIndex        =   0
  41.       Top             =   450
  42.       Width           =   4095
  43.    End
  44.    Begin VB.Data dbaSkill 
  45.       Caption         =   "Skill"
  46.       Connect         =   "Access"
  47.       DatabaseName    =   "c:\sams\maketeam"
  48.       Exclusive       =   0   'False
  49.       Height          =   300
  50.       Left            =   0
  51.       Options         =   0
  52.       ReadOnly        =   0   'False
  53.       RecordsetType   =   1  'Dynaset
  54.       RecordSource    =   "tblSkill"
  55.       Top             =   30
  56.       Visible         =   0   'False
  57.       Width           =   3465
  58.    End
  59.    Begin RichtextLib.RichTextBox txtDetail 
  60.       Height          =   2235
  61.       Left            =   210
  62.       TabIndex        =   1
  63.       Top             =   1260
  64.       Width           =   6165
  65.       _Version        =   65536
  66.       _ExtentX        =   10874
  67.       _ExtentY        =   3942
  68.       _StockProps     =   69
  69.       BackColor       =   -2147483643
  70.       TextRTF         =   $"AddSkill.frx":0000
  71.    End
  72. Attribute VB_Name = "frmAddSkill"
  73. Attribute VB_Creatable = False
  74. Attribute VB_Exposed = False
  75. Option Explicit
  76. Private Sub cmdCancel_Click()
  77.   gAction = -1
  78.   Unload frmAddSkill
  79. End Sub
  80. Private Sub cmdSave_Click()
  81.   If gAction = 1 Then
  82.     dbaSkill.Recordset.AddNew
  83.   Else
  84.     dbaSkill.Recordset.Edit
  85.   End If
  86.   dbaSkill.Recordset![Name] = txtName
  87.   dbaSkill.Recordset![Detail] = txtDetail
  88.   dbaSkill.Recordset![LastUpdate] = Now
  89.   dbaSkill.UpdateRecord
  90.   gAction = 0
  91.   Unload frmAddSkill
  92. End Sub
  93. Private Sub Form_Load()
  94.   Left = (Screen.Width - Width) / 2
  95.   TOP = (Screen.Height - Height) / 2
  96.   MousePointer = 0
  97.   dbaSkill.DatabaseName = gMainDBName
  98.   dbaSkill.Refresh
  99.   PrepForm
  100. End Sub
  101. Sub PrepForm()
  102.   If gAction = 1 Then
  103.     'Add
  104.     frmAddSkill.Caption = "Add New Skill"
  105.     txtName = ""
  106.     txtDetail = ""
  107.   Else
  108.     'Edit
  109.     dbaSkill.Recordset.Edit
  110.     frmAddSkill.Caption = "Edit a Skill"
  111.     dbaSkill.Recordset.FindFirst "SkillKey=" + gSkillKey
  112.     txtName = dbaSkill.Recordset![Name]
  113.     txtDetail = dbaSkill.Recordset![Detail]
  114.   End If
  115. End Sub
  116.