VBA Email Loop to send a report in Microsoft Access -
please i've been struggling week now.
there’s report run in microsoft access,i’m trying create button send 8 reports 8 different people without me having click send (or edit messages). created form query 8 references(adc) , email addresses referencing in code, i've attached below. main issues right are:
- it still opening message edit when i've input "false" in docmd.
- linking corresponding adc report right email.
private sub loop_email_click() docmd.openform formname:="frm_looper", view:=acnormal, datamode:=acformpropertysettings, windowmode:=acwindownormal dim email, adc docmd.gotorecord , , aclast 'forms!frm_looper![adc] set email = forms!frm_looper!emailaddress set adc = forms!frm_looper!adc docmd.sendobject acsendreport, "report2", acformatpdf, email, , , "quarterback report " & adc, "please not reply address. automated.", false 'msgbox "you sent last report", vbokonly, "" ' go looper while adc > 1 docmd.gotorecord , , acprevious 'msgbox "you should @ previous record", vbokonly, "" set email = forms!frm_looper!emailaddress set adc = forms!frm_looper!adc docmd.sendobject acsendreport, "report2", acformatpdf, email, , , "quarterback report " & adc, "please not reply address. automated.", false 'msgbox "you sent last report", vbokonly, "" ' go looper loop 'msgbox "made through loop.", vbokonly, "" end sub
Comments
Post a Comment