Full Version: Email a Record
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
steviecheesecake
All,

I think I know the answer (cannot be done), but, I'll ask anyways:

I have a trouble ticket database, that I use to store my sections active
trouble tickets. However, trouble tickets need to be sent higher up in some
cases to be resolved. I am trying to find a way to stick a button on the
form that will allow me to click it and have the current record load up in
Outlook to be ready to ship.

A report would be nice, as I could format it as needed, but, at this point,
I'll take whatever. Right now I can only seem to send ALL my records.
There must be a way to send just the current record open.

Any suggestions would be greatly appeciated.

Shep
freakazeud
Hi,
welcome to UA forums!
Why so pecimistic?
You could go both ways. Either send directly from your form with a button,
or create a report with this one record and then send it as an attachment in an e-mail.
I'm attaching some sample code for the first method:

Dim strToWhom As String
Dim strMsgBody As String
Dim strSubject As String
Dim Fname As String
Dim Lname As String

Fname = Forms!frmQryDueRetest!EmployeFirstName
Lname = Forms!frmQryDueRetest!EmployeLastName

strSubject = ("Mr/Ms " + [Lname] + ", " + [Fname] + " is due for tests!")
strToWhom = txtemailsupervisor.Value '<-- this is a field that holds an e-mail on the form or just use "email@e-mail.com"
strMsgBody = ("Mr/Ms " + [Lname] + ", " + [Fname] + " is due for tests!" & vbCrLf & "Your next line" & vbCrLf & vbCrLf & "two more lines down with more information in the body or whatever you want...")

DoCmd.SendObject , , , strToWhom, , , strSubject, strMsgBody, True

Just need to modify it for you to work with all your fields!
If you want to go the second route then check this: current record only
to get you started!

HTH
Good luck
steviecheesecake
Thanks for the help.

I'll give it a shot and let you know how it goes.

Shep
Thanks for the welcome!
freakazeud
You're welcome.
Glad I could assist.
Good luck on future projects!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.