forms - Microsoft Access Send email to Client and get Email address from database -


gday all,

i'm trying send report microsoft access client.

so have client table client details including email address etc..

and in form using button linked macro creates report , sends via email using "emaildatabaseobject" way cannot select email address list in clients section have type 1 in macro builder or leave blank , prompted it.

is there anyway have select query linked "to" section of emaildatabaseobject?

or there way should trying this?

have @ this:

public sub cmdterms_click()  dim objoutlook new outlook.application dim objmail mailitem dim knownas string dim eml string dim text string dim pathname string dim pathname2 string dim quest integer dim rs dao.recordset  docmd.transfertext acexportmerge, "", "qryterms", conaddrpth & "\datasource.txt", true, "", 1252 

me.docname = conaddrpth & "\dbs service agreement.docm" openworddoc

knownas = dlookup("fname", "qryterms") eml = dlookup("email", "qryterms") text = "dear " & knownas & vbcr & vbcr & "i'd grateful if read attached code of practice , " & _    "service level agreement." & vbcr & vbcr & _    "if happy these terms please complete, sign , return pages 1 , " & _    "two of attachment. " & vbcr & vbcr & "please let me know if have questions or concerns." & vbcr & vbcr & _    "with best wishes." & vbcr & vbcr & emailsig  pathname = conaddrpth & "\dbs service agreement.pdf"  set objoutlook = new outlook.application set objmail = objoutlook.createitem(olmailitem)  objmail .to = eml .subject = "dbs checking service" .body = text .noaging = true .attachments.add pathname .display (true) end  set objmail = nothing set objoutlook = nothing  end sub 

it's use. above procedure on form. form have data such address etc. employ word mail merge make report (or letter). easy send report if necessary.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -