Email current record for form (3 Viewers)

KarimR

New member
Local time
Today, 21:08
Joined
Oct 27, 2025
Messages
1
Hi All

I very new to MS Access. I have built a database for me a record any repairs that a tenant requires. I want to be able to email a contractor the record I have just created.

The following code works but it pdf’s the whole form.


DoCmd.SendObject acSendForm, "frm_repairs", acFormatPDF, Forms!frm_repairs!ContractorEmail, , , _

"Repairs Requested ", "Please find attached repairs requested by the tenant."


I would be grateful for any suggestions
 
As Gasman says, you need a report that formats the work order exactly as you want to send it to the contractor. It can be similar to the appearance of the form, but will probably be quite different -- based on your description of the problem.

For the report, create a query with a WHERE clause that matches the WHERE clause for the form's recordsource so your report includes the same selected records.

Create and email a PDF from the report.
 
there is a display when property for controls
1761656190160.png


So you can set to screen only (and use the can grow/shrink properties if required, they only work when printing the form)

and of course you might have a control you want to show when printing, but not on the screen

All depends on how your form would look with various controls hidden
 
As an option, you can create your "Repairs" as a text string. You would then pass your string as the last parameter.
This would allow you to skip creating an attachment. Something like

strBody = "Tenant " & frm_repairs.Tenant & " in building " & frm_repairs.TenantAddress & vbCrLf & _
"Requests the following repairs" & vbCrLf & frm_repairs.TxtRepairs

Were it me, I'd do this even if you are still including a form. Met too many people who can't be bothered to open an attachment on their phone but have no problem reading the email.
 

Users who are viewing this thread

Back
Top Bottom