send attachment with email in an ms access form

I'm using the code below to send emails from access. I would like to add code to send the attachment from the access attachment field on the form.... see sample form attached

Dim rs As DAO.Recordset

'On Error Resume Next
 Set rs = CurrentDb.OpenRecordset("qryEmail_Reminder_RecordSet_Apps")
With rs
 If .EOF And .BOF Then 'IT MEANS THERE ARE NO RECORDS, WE ARE AT THE BEGINNING OF FILE AND END OF FILE (No Records found for this query.)
 MsgBox " No emails will be sent because there are no records from the query ‘Email_Reminder_RecordSet_Apps’ "
Else
 Do Until .EOF 'DO UNTIL END OF RECORDSET FILE

'THE NEXT LINE SENDS THE EMAIL MESSAGE

DoCmd.SendObject acSendNoObject, , , ![Send_Email], , , "New Application Access", "Hello " & ![Send_To] & _
", " & Chr(10) & "Please grant access to " & ![First_Name] & _
" " & ![Last_Name] & _
", " & ![User_Email] & _
" to the following application: " _
& Chr(10) & ![App_Site_Name] & Chr(10) & Chr(10) _
& Chr(10) _
& Chr(10) _
& Chr(10) _
& "Thanks, " & Chr(10) _
& "V hields" _
& Chr(10) _
& "DSPC"


.Edit
 ![Email_Sent_Date] = Now()
 .Update
 

 .MoveNext 'THIS MOVES TO THE NEXT RECORD IN THE RECORDSET
 Loop

End If
 End With





'CLEAN UP MEMORY AT END
 If Not rs Is Nothing Then
 rs.Close
 Set rs = Nothing
 End If

Open in new window

Capture.JPG
shieldscoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You cannot send attachments using SendObject. You'd have to use Outlook automation (assuming you're using Outlook for email), or something along those lines.

Patrick Matthews has a good article on automating outlook from Access, which includes methods to manage attachments:

https://www.experts-exchange.com/articles/4316/Automate-Outlook-in-VBA-with-the-OutlookCreateItem-Class.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.