Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending Report via Email

0 views
Skip to first unread message

Bob Vance

unread,
Apr 12, 2008, 8:34:31 PM4/12/08
to
My Db has 2 ways of sending a report via email
(1) OwnerStatement, which just creates the email, then you manually send it
(2) Invoice , which sends the report via email on deactivate, I am trying to
get Invoice to just create the email and then you can send it manually like
ownerStatement
Thanks in advance for any help with this......Bob

Both codes are listed below
--------------------------------------------------------
Private Sub SendMailButton_Click()
On Error GoTo ErrorHandler
Dim lngID As Long, strMail As String, strBodyMsg As String, _
blEditMail As Boolean, sndReport As String, strCompany As String
Dim msgPmt As String, msgBtns As Integer, msgTitle As String, msgResp As
Integer

Select Case Me.OpenArgs
Case "OwnerStatement"
sndReport = "rptOwnerPaymentMethod"

lngID = Nz(Me.cbOwnerName.Column(0), 0)
strMail = OwnerEmailAddress(lngID)

strBodyMsg = "Dear "
strBodyMsg = strBodyMsg & Nz(DLookup("[ClientTitle]",
"tblOwnerInfo", _
"[OwnerID]=" & lngID), " ") & " "
strBodyMsg = strBodyMsg & Nz(DLookup("[OwnerLastName]",
"tblOwnerInfo", _
"[OwnerID]=" & lngID), " Owner")
strBodyMsg = strBodyMsg & "," & Chr(10) & Chr(10) & Chr(13) _
& "Attached is your Statement for the period from " &
Format(Me.tbDateFrom, "d-mmm-yy") _
& " to " & Format(Me.tbDateTo, "d-mmm-yy") & "." _
& eMailSignature("Best Regards", True) & Chr(10) & Chr(10) _
& DownloadMessage("rtf")


DoCmd.SendObject acSendReport, sndReport, acFormatRTF, strMail,
, , "Your Statement", _
strBodyMsg, True

Case Else
Exit Sub

End Select
Exit Sub

ErrorHandler:

msgTitle = "Untrapped Error"
msgBtns = vbExclamation
If Err.Number = 2501 Then 'Prevent error when send is canceled
Err.Clear
Exit Sub
End If
MsgBox "Error Number: " & Err.Number & Chr(13) _
& "Description: " & Err.Description & Chr(13) & Chr(13) _
& "(frmBillStatement SendMailButton_Click)", msgBtns, msgTitle


End Sub
---------------------------------------------------------------------------------
Private Sub Report_Deactivate()

On Error GoTo Error_Handler

Dim lngID As Long, strMail As String, strBodyMsg As String, _
blEditMail As Boolean, dtInvDate As Date, varInvNum As Variant, _
idHorse As Long, strHorse As String


Dim msgPmt As String, msgBtns As Integer, msgTitle As String, msgResp
As Integer

If CurrentProject.AllForms("frmModify").IsLoaded = True Then
lngID = DLookup("OwnerID", "tblInvoice", "InvoiceID = " _
& Form_frmModify.lstModify.Column(0))
ElseIf CurrentProject.AllForms("frmModifyInvoiceClient").IsLoaded = True
Then
lngID = DLookup("OwnerID", "tblInvoice", "InvoiceID = " _
& Form_frmModifyInvoiceClient.lstModify.value)
Else
Exit Sub
End If

strMail = Nz(DLookup("Email", "tblOwnerInfo", "OwnerID = " & lngID), "")

If Not IsEmailOn Or Not IsOwnerWithEmail(lngID) Then
Exit Sub
End If

dtInvDate = Me.tbInvoiceDate
varInvNum = Me.tbInvoiceNumber
idHorse = Nz(Me.tbHorseID, 0)
If idHorse <> 0 Then
strHorse = Nz(DLookup("[HorseName]", "tblHorseInfo", "[HorseID]=" &
idHorse), "")
Else
strHorse = ""
End If

strBodyMsg = "Dear "
strBodyMsg = strBodyMsg & Nz(DLookup("[ClientTitle]", "tblOwnerInfo",
"[OwnerID]=" & lngID), " ") & " "
strBodyMsg = strBodyMsg & Nz(DLookup("[OwnerLastName]", "tblOwnerInfo",
"[OwnerID]=" & lngID), " Owner")
strBodyMsg = strBodyMsg & "," & Chr(10) & Chr(10) & Chr(13) _
& "Attached is your " & varInvNum & " Dated " & Format(dtInvDate,
"d-mmm-yyyy") _
& IIf(Len(strHorse) > 0, " for " & strHorse, "") & "." _
& eMailSignature("Best Regards", True) & Chr(10) & Chr(10) & Chr(13) _
& DownloadMessage("rtf")

If strMail = "Null" Or Len(strMail) = 0 Or _
DLookup("[MailFlag]", "tblAdminSetup") = False Then
Exit Sub
End If

DoCmd.SendObject acSendReport, Me.Name, acFormatRTF, strMail, , , "Your
Invoice", _
strBodyMsg, blEditMail


Exit Sub


If MsgBox("Do you want to send Email??", vbYesNo + vbDefaultButton2)
= vbYes Then

DoCmd.SendObject acSendReport, Me.Name, acFormatRTF,
strMail, , , _
"Your Invoice", strBodyMsg, True ' ** Change to "False"
later
End If

Exit Sub

Error_Handler:
Select Case Err.Number
Case 2501
Case 2487
Resume Next
Case Else
MsgBox "Error Number: " & Err.Number & Chr(13) _
& "Description: " & Err.Description, , "Untrapped Error"

End Select

End Sub
--
Thanks in advance for any help with this......Bob
WindowsXP..MS Access 2007


Pete D.

unread,
Apr 13, 2008, 3:02:30 PM4/13/08
to
You need the last paramiter, Don't know what blEditMail is set by but I
select it is in your button that calls the report. Change it to True.Edit
Message Specifies whether the message can be edited before it's sent. If you
select Yes, the electronic mail application starts automatically, and the
message can be edited. If you select No, the message is sent without the
user having a chance to edit the message. The default is Yes.


"Bob Vance" <rjv...@ihug.co.nz> wrote in message
news:ftrkfo$5tt$1...@lust.ihug.co.nz...

noreply@noreply

unread,
Sep 13, 2008, 10:35:44 PM9/13/08
to
In increase to this, Square-Enix has announced plans for unveiling the new Mythological Weapons through a idea titled "Summit 2008" which faculty be a variety of partnership between Square-Enix and the fan sites they cov infamy[/url:1twkqe7z]hump designated execute sites. More info can be launc (http&#58;//ugamegold&#46;com/city-of-villains-infamy/:1twkqe7z).

noreply@noreply

unread,
Oct 2, 2008, 12:07:44 PM10/2/08
to
Bump! thx !


It was the first day of school.

As the principal made his rounds, he heard a terrible
commotion coming from one of the classrooms.

He rushed in and spotted one boy, taller than the others, who seemed to be making the most noise.

He seized the lad, dragged him to the hall, and told him to wait there until he was excused.

Returning to the classroom, the principal restored order and lectured the class for half an hour about the importance of good behavior.

"Now," he said, "are there any questions?"

One girl stood up timidly. " Please sir," she asked, "May we have our teacher back?"
* Pet products[/url:3hut95dt], dog bed[/url:3hut95dt], pet supply[/url:3hut95dt], Dog Collar[/url:3hut95dt], Dog Clothes[/ur (http&#58;//www&#46;lovelonglong&#46;co (http&#58;//www&#46;lovelonglong&#46;co (http&#58;//www&#46;lovelonglong&#46;co (http&#58;//www&#46;lovelonglong&#46;co (http&#58;//www&#46;lovelonglong&#46;com:3hut95dt)95dt)95dt)95dt)95dt)95dt] *

noreply@noreply

unread,
Oct 2, 2008, 9:50:52 PM10/2/08
to
bump up
lurk

I believe that we are not real social workers. We may be doing social work in the eyes of the people, but we are really contemplatives in the heart of the world. For we are touching the body of Christ twenty-four hours 26And I think that in our family we don 19t need bombs and guns, to destroy, to bring peace, just get together, love one another, bring that peace, that joy, that strength of presence of each other in the home. And we will be able to overcome all the evil that is in the world.

Thsale is a professional, loyal and reliable wow gold supplier online, we pioneered selling cheap wow gold. Welcome to thsale buy world of warcraft gold Buy Cheap WoW Gold, World of Warcraft Gold, Please look here! We are a Great MMORPG company. wow money and wow items,which is very cheap WOW Gold�01All US Server 24.99$/1000G on sell! Cheap wow gold,rs powerleveling,wow power leveling,Buy Cheapest/Safe/Fast WoW US EU Gold Power leveling
------------------------------
White tea[/url:3glvqry1], Herbal Tea[/url:3glvqry1], Jasmine tea[/url:3glvqry1], Chinese Tea[/url:3glvqry1], Green Tea[/url:3 (http&#58;//www&#46;tea-of-chinese&#46;com/white-tea&#46;html:3 (http&#58;//www&#46;tea-of-chinese&#46;com/herbal-tea&#46;html:3 (http&#58;//www&#46;tea-of-chinese&#46;com/jasmine-tea&#46;html:3 (http&#58;//www&#46;tea-of-chinese&#46;com/chinese-tea&#46;html:3 (http&#58;//www&#46;tea-of-chinese&#46;com/green-tea&#46;html:3glvqry1)1)1)1)1)1],

noreply@noreply

unread,
Oct 13, 2008, 5:04:03 AM10/13/08
to
[font=Tahoma][size=36pt][size=10:1lgygqyy][size=3][font=Times New Roman]Lineage II is a medieval-style fantasy MMORPG and a true continuation of the original Lineage. [color=#0000ff:1lgygqyy]Adena[/color:1lgygqyy][/url:1lgygqyy] is the currency ( [color=#0000ff:1lgygqyy]Lineage 2 money [/color:1lgygqyy][/url:1lgygqyy]) in Lineage II. The more [color=#0000ff:1lgygqyy]Lineage 2 adena[/color:1lgygqyy][/url:1lgygqyy] you have,the better items you may get. Buy [color=#0000ff:1lgygqyy]Lineage adena[/color:1lgygqyy][/url:1lgygqyy] would be the best way to get a large sum of Lineage[/font][/si (http&#58;//www&#46;3zoom&#46;com/l2-Luna/cheap-adena-1-2028&#46;ht (http&#58;//www&#46;3zoom&#46;com/l2-Luna/cheap-adena-1-2028&#46;ht (http&#58;//www&#46;3zoom&#46;com/l2-Luna/cheap-adena-1-2028&#46;ht (http&#58;//www&#46;3zoom&#46;com/l2-Luna/cheap-adena-1-2028&#46;html:1lgygqyy)ygqyy)ygqyy)ygqyy)ygqyy]
[size=3:1lgygqyy][font=Times New Roman]adena. [color=#0000ff:1lgygqyy]Lineage 2 account[/color:1lgygqyy][/url:1lgygqyy] features considerably enhanced first-person 3D graphics over its predecessor by utilizing the Unreal 2.0 Engine developed by Epic Games. There are five choices of races to play in this MMOG; Dark Elf, Dwarf, Elf, Human or Orc, and a player can keep up to seven characters on a server. Gameplay is either solo or grouped and either PvE or PvP. In order to gain experience points, new skills, and various item drops, monsters can be battled and quests can be completed. Also, there are many social, political and economic aspects to participate in as you travel the expanse of Aden.[/font][/si (http&#58;//www&#46;3zoom&#46;com/:1lgygqyy)ygqyy]
[/size][/size][/font]

0 new messages