awsha
Jan 13th, 2004, 11:15 PM
I'm using SendObject method to send a data where i fetch from a table. The problem i'm facing rite now is I just can send the mail only once. In my form I have 2 textboxes, 1 for E-mail subject the other one is for the message box, 2 command buttons 1 for fetching data from table to put into the msg box and the other one for sending. Below is the code
Fetching data
Private Sub Command2_Click()
Dim dbs As Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("MyTable")
'// MSG1 is Text Box for Message body
Do While Not rst.EOF
Me.MSG1.Value = Me.MSG1.Value & rst!Filed1 & " " & rst!Field2 & " " & "verified by " & rst!Field3 & " (" & rst!Field4 & ")" & Chr(13) + Chr(10)
Me.MSG1.ScrollBars = 2
rst.MoveNext
Loop
rst.close
End Sub
Sending E-mail
Private Sub Command3_Click()
Dim MSG, subj2 As String
MSG = Me.MSG1.Value
subj2 = Me.Subject1.Value
DoCmd.SendObject acSendNoObject, , , "receiver", , , subj2, MSG, False
pls help me
Fetching data
Private Sub Command2_Click()
Dim dbs As Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("MyTable")
'// MSG1 is Text Box for Message body
Do While Not rst.EOF
Me.MSG1.Value = Me.MSG1.Value & rst!Filed1 & " " & rst!Field2 & " " & "verified by " & rst!Field3 & " (" & rst!Field4 & ")" & Chr(13) + Chr(10)
Me.MSG1.ScrollBars = 2
rst.MoveNext
Loop
rst.close
End Sub
Sending E-mail
Private Sub Command3_Click()
Dim MSG, subj2 As String
MSG = Me.MSG1.Value
subj2 = Me.Subject1.Value
DoCmd.SendObject acSendNoObject, , , "receiver", , , subj2, MSG, False
pls help me