home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / handson / archive / Issue159 / files / copyvbwk.exe / SendToRecipient.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1999-10-03  |  2.6 KB  |  92 lines

  1. VERSION 5.00
  2. Begin VB.Form SendToRecipient 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Send"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   6030
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   3195
  13.    ScaleWidth      =   6030
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.TextBox xName 
  16.       DataField       =   "Name"
  17.       DataSource      =   "Data1"
  18.       Height          =   375
  19.       Left            =   1200
  20.       TabIndex        =   2
  21.       Top             =   720
  22.       Width           =   2295
  23.    End
  24.    Begin VB.Data Data1 
  25.       Connect         =   "Access"
  26.       DatabaseName    =   "C:\pcplus\vbwkshp\issue159\newslist.mdb"
  27.       DefaultCursorType=   0  'DefaultCursor
  28.       DefaultType     =   2  'UseODBC
  29.       Exclusive       =   0   'False
  30.       Height          =   615
  31.       Left            =   1440
  32.       Options         =   0
  33.       ReadOnly        =   0   'False
  34.       RecordsetType   =   1  'Dynaset
  35.       RecordSource    =   "Recipients"
  36.       Top             =   2280
  37.       Width           =   2175
  38.    End
  39.    Begin VB.CommandButton Send 
  40.       Caption         =   "Send"
  41.       Height          =   375
  42.       Left            =   4680
  43.       TabIndex        =   1
  44.       Top             =   600
  45.       Width           =   1215
  46.    End
  47.    Begin VB.CommandButton OKButton 
  48.       Caption         =   "Exit"
  49.       Height          =   375
  50.       Left            =   4680
  51.       TabIndex        =   0
  52.       Top             =   120
  53.       Width           =   1215
  54.    End
  55.    Begin VB.Label Label1 
  56.       Caption         =   "Name"
  57.       Height          =   255
  58.       Left            =   120
  59.       TabIndex        =   3
  60.       Top             =   720
  61.       Width           =   975
  62.    End
  63. Attribute VB_Name = "SendToRecipient"
  64. Attribute VB_GlobalNameSpace = False
  65. Attribute VB_Creatable = False
  66. Attribute VB_PredeclaredId = True
  67. Attribute VB_Exposed = False
  68. Option Explicit
  69. Private Sub OKButton_Click()
  70. Me.Hide
  71. End Sub
  72. Private Sub Send_Click()
  73. Dim ws As Workspace, r As Integer
  74. Set ws = Workspaces(0)
  75. Dim s As String, t As String
  76. ws.BeginTrans
  77. If xName.Text <> "" Then
  78.     With Data1.Recordset
  79.         .Edit
  80.         !LastIssueNumber = Code.issueNumber
  81.         .Update
  82.     End With
  83.     Call SendMail(Data1.Recordset.Fields!Name, Data1.Recordset.Fields!EMail)
  84.     MsgBox "No name selected!"
  85. End If
  86. r = MsgBox("Do you want to commit?", vbYesNo)
  87. If r = vbYes Then
  88.     ws.CommitTrans
  89.     ws.Rollback
  90. End If
  91. End Sub
  92.