home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Unleashed
/
Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso
/
source
/
chap36
/
addjob.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1995-09-19
|
3KB
|
117 lines
VERSION 4.00
Begin VB.Form frmAddJobtitle
BorderStyle = 3 'Fixed Dialog
Caption = "Add Jobtitle"
ClientHeight = 3690
ClientLeft = 1545
ClientTop = 3000
ClientWidth = 6585
ControlBox = 0 'False
Height = 4095
Left = 1485
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3690
ScaleWidth = 6585
ShowInTaskbar = 0 'False
Top = 2655
Width = 6705
Begin VB.CommandButton cmdCancel
Caption = "&Cancel"
Height = 465
Left = 5130
TabIndex = 3
Top = 600
Width = 1245
End
Begin VB.CommandButton cmdSave
Caption = "&Save"
Height = 465
Left = 5130
TabIndex = 2
Top = 90
Width = 1245
End
Begin VB.TextBox txtName
Height = 285
Left = 210
TabIndex = 0
Top = 450
Width = 4095
End
Begin VB.Data dbaJobtitle
Caption = "Skill"
Connect = "Access"
DatabaseName = "maketeam"
Exclusive = 0 'False
Height = 300
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "tblJobtitle"
Top = 60
Visible = 0 'False
Width = 3105
End
Begin RichtextLib.RichTextBox txtDetail
Height = 2235
Left = 210
TabIndex = 1
Top = 1260
Width = 6165
_Version = 65536
_ExtentX = 10874
_ExtentY = 3942
_StockProps = 69
BackColor = -2147483643
TextRTF = $"AddJob.frx":0000
End
Attribute VB_Name = "frmAddJobtitle"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
gAction = -1
Unload frmAddJobtitle
End Sub
Private Sub cmdSave_Click()
If Len(Trim(txtName)) < 1 Then
MsgBox "Must enter a name.", 48, gProgramTitle
txtName.SetFocus
Exit Sub
End If
If gAction = 1 Then
dbaJobtitle.Recordset.AddNew
Else
dbaJobtitle.Recordset.Edit
End If
dbaJobtitle.Recordset![Name] = txtName
dbaJobtitle.Recordset![Detail] = txtDetail
dbaJobtitle.Recordset![LastUpdate] = Now
dbaJobtitle.UpdateRecord
gAction = 0
Unload frmAddJobtitle
End Sub
Private Sub Form_Load()
Left = (Screen.Width - Width) / 2
TOP = (Screen.Height - Height) / 2
MousePointer = 0
dbaJobtitle.DatabaseName = gMainDBName
dbaJobtitle.Refresh
If gAction = 1 Then
'Add
txtName = ""
txtDetail = ""
frmAddJobtitle.Caption = "Add New Title"
Else
'Edit
frmAddJobtitle.Caption = "Edit a Title"
dbaJobtitle.Recordset.FindFirst "JobtitleKey=" + gJobtitleKey
txtName = dbaJobtitle.Recordset![Name]
txtDetail = dbaJobtitle.Recordset![Detail]
End If
End Sub