Last day of the last Month Code

B

Bob Vance

Trying to add the last day of the last month to this part of my code for
emailing

& "Attached is your Statement " & " Dated " & DateAdd("d", -1# *
DatePart("d", Today), Today) & eMailSignature("Best Regards", True) &
Chr(10) & Chr(10) _
 
J

John W. Vinson

Trying to add the last day of the last month to this part of my code for
emailing

& "Attached is your Statement " & " Dated " & DateAdd("d", -1# *
DatePart("d", Today), Today) & eMailSignature("Best Regards", True) &
Chr(10) & Chr(10) _

Try instead: "Attached is your Statement Dated " & DateSerial(Year(Date()),
Month(Date()) + 1, 0) & emailSignature("Best Regards", True) & vbCrLf & vbCrLf

There is no Today in Access; Date() is today's date.

I presume you have a function eMailSignature.
 
B

Bob Vance

John W. Vinson said:
Try instead: "Attached is your Statement Dated " &
DateSerial(Year(Date()),
Month(Date()) + 1, 0) & emailSignature("Best Regards", True) & vbCrLf &
vbCrLf

There is no Today in Access; Date() is today's date.

I presume you have a function eMailSignature.
Thanks John did it on todays date BRILLIANT!! regards Bob
Yes do have an emailsignature thanks

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 " & eMailSignature("Best
Regards", True) & Chr(10) & Chr(10) _
& DownloadMessage("snp")
 
J

John W. Vinson

John W. Vinson [MVP]
Thanks John did it on todays date BRILLIANT!! regards Bob
Yes do have an emailsignature thanks

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 " & eMailSignature("Best
Regards", True) & Chr(10) & Chr(10) _
& DownloadMessage("snp")

Just note that Chr(10) is a LineFeed character. A newline is a carriage return
followed by a linefeed - either

Chr(13) & Chr(10)

or you can use the VBA constant vbCrLf. A plain linefeed will probably show up
as a little box character.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top