Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 jupgraded to Access 2010 - code not working

Status
Not open for further replies.

Stacey1306

Technical User
Nov 3, 2013
12
AU
Hello,
I had previously created an invoice email blast in Access 2007, now I have upgraded to Access 2010 the code is not working. The highlighted line is where I am getting an error message.

Please advise :

Private Sub Command52_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim qd As DAO.QueryDef

Set db = CurrentDb
Set rs = db.OpenRecordset("qryEmailInvoices", dbOpenDynaset)

' qselEmailInvoiceSingleMember is the name of your new query that is the record source of your report
Set qd = db.QueryDefs("qselEmailInvoiceSingleMember")
rs.MoveFirst
Do
vMemberID = rs("MemberID")
'strSQL is the SQL view of qselEmailInvoiceSingleMember
strSQL = "SELECT * FROM qryEmailInvoices WHERE MemberID = " & vMemberID
qd.SQL = strSQL
DoCmd.SendObject acSendReport, "Email Invoices", "PDFFormat(*.pdf)", rs("Email"),_
"", "", "Northern Beaches Local Liquor Accord Membership", _
"Hello [First Name], " & vbCrLf & vbCrLf & _
"Please find the attached invoice for your Membership dues for payment." & vbCrLf & vbCrLf & _
"Please note that payment is due within 14 days of date of invoice, after which your membership may be cancelled." & vbCrLf & vbCrLf & _
"We appreciate your continued support and prompt attention to this matter." & vbCrLf & vbCrLf & _
"Kind regards" & vbCrLf & "Northern Beaches Local Liquor Accord", False
rs.MoveNext
Loop Until rs.EOF
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
 
your continuation character is up against the coma
 
Hi MajP,

So do I remove the comma's ????
What does your reply mean
 
rs("Email"),_ 'no space is wrong between the comma and the continuation character _
rs("Email"), _ 'space is correct
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top