home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form AddRecipient
- BorderStyle = 3 'Fixed Dialog
- Caption = "Add Recipient"
- ClientHeight = 3195
- ClientLeft = 2760
- ClientTop = 3750
- ClientWidth = 6030
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3195
- ScaleWidth = 6030
- ShowInTaskbar = 0 'False
- Begin VB.Data Data1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = "C:\pcplus\vbwkshp\issue159\newslist.mdb"
- DefaultCursorType= 0 'DefaultCursor
- DefaultType = 2 'UseODBC
- Exclusive = 0 'False
- Height = 375
- Left = 480
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "Recipients"
- Top = 2160
- Visible = 0 'False
- Width = 1575
- End
- Begin VB.CommandButton Save
- Caption = "Add"
- Height = 375
- Left = 4680
- TabIndex = 5
- Top = 600
- Width = 1215
- End
- Begin VB.TextBox xAddress
- Height = 375
- Left = 480
- TabIndex = 2
- Top = 1440
- Width = 3255
- End
- Begin VB.TextBox xName
- Height = 375
- Left = 480
- TabIndex = 1
- Top = 480
- Width = 3255
- End
- Begin VB.CommandButton OKButton
- Caption = "Exit"
- Height = 375
- Left = 4680
- TabIndex = 0
- Top = 120
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Address"
- Height = 375
- Left = 480
- TabIndex = 4
- Top = 1080
- Width = 1335
- End
- Begin VB.Label Label1
- Caption = "Name"
- Height = 375
- Left = 480
- TabIndex = 3
- Top = 120
- Width = 1335
- End
- Attribute VB_Name = "AddRecipient"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Activate()
- Data1.Refresh
- End Sub
- Private Sub OKButton_Click()
- Me.Hide
- End Sub
- Private Sub Save_Click()
- On Error GoTo A
- If xName.Text <> "" Then
- With Data1.Recordset
- .AddNew
- !Name = xName.Text
- !EMail = xAddress.Text
- .Update
- End With
- End If
- xAddress.Text = ""
- xName.Text = ""
- Exit Sub
- MsgBox ("Database update failed")
- End Sub
-