home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmAddProject
- Caption = "Add Project"
- ClientHeight = 3690
- ClientLeft = 1350
- ClientTop = 2085
- ClientWidth = 6585
- ControlBox = 0 'False
- Height = 4095
- Left = 1290
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3690
- ScaleWidth = 6585
- Top = 1740
- 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 dbaProject
- Caption = "Project"
- Connect = "Access"
- DatabaseName = "c:\sams\maketeam"
- Exclusive = -1 'True
- Height = 300
- Left = 0
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "qryProject"
- Top = 60
- Visible = 0 'False
- Width = 3255
- End
- Begin RichtextLib.RichTextBox txtDetail
- DataField = "Name"
- DataSource = "dbaProject"
- Height = 2235
- Left = 210
- TabIndex = 1
- Top = 1260
- Width = 6165
- _Version = 65536
- _ExtentX = 10874
- _ExtentY = 3942
- _StockProps = 69
- BackColor = -2147483643
- TextRTF = $"AddPrj.frx":0000
- End
- Attribute VB_Name = "frmAddProject"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Sub PrepForm()
- If gAction = 1 Then
- 'Add
- frmAddProject.Caption = "Add New Project"
- txtName = ""
- txtDetail = ""
- Else
- 'Edit
- frmAddProject.Caption = "Edit a Project"
- dbaProject.Recordset.FindFirst "ProjectKey=" + gProjectKey
- txtName = dbaProject.Recordset![Name]
- txtDetail = dbaProject.Recordset![Detail]
- End If
- End Sub
- Private Sub cmdCancel_Click()
- gAction = -gAction
- Unload frmAddProject
- 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
- dbaProject.Recordset.AddNew
- Else
- dbaProject.Recordset.Edit
- End If
- dbaProject.Recordset![Name] = txtName
- dbaProject.Recordset![Detail] = txtDetail
- dbaProject.Recordset![LastUpdate] = Now
- dbaProject.UpdateRecord
- gAction = 0
- Unload frmAddProject
- End Sub
- Private Sub Form_Load()
- Left = (Screen.Width - Width) / 2
- TOP = (Screen.Height - Height) / 2
- MousePointer = 0
- dbaProject.DatabaseName = gMainDBName
- dbaProject.Refresh
- PrepForm
- End Sub
-