Full Version: Forms
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
mike60smart
Is it possible to send the Current Record in a Form as an email ?

Your help appreciated
ScottGem
Yes
ScottGem
Oh I guess you want to know HOW to do it wink.gif

Check out the SendObject method in Access Help.
freakazeud
Mhhhh,
this might be a little difficult I think.
As far as I know the send object method only sends tables/queries and not just one (current record).
A workaround might be to create a temp table which just holds one record (current) and then send that table.
Or you can set the data entry property of the form to "no" and do it with some code to determine the current record, here some scrap code:

' fetch the single (unique) record as a new record source
strNewRecord = "SELECT * FROM Incident WHERE User_Name = " _
& User_Name
' MsgBox "sql: " & strNewRecord
Me.RecordSource = strNewRecord
' email HTML to whoTo
DoCmd.SendObject acSendForm, , acFormatHTML, whoTo, , , _
"New Computer Incident", , 0

Exit_Send_Click:
' reset to original records.
strNewRecord = "SELECT * FROM Incident "
Me.RecordSource = strNewRecord
DoCmd.GoToRecord acForm, Screen.ActiveForm.name, acNewRec

DoCmd.GoToControl ctl.name ' go back to form, field User_Name

HTH
Good luck
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.