E-mailing (Current record from a form)

  • Thread starter Very Basic User
  • Start date
V

Very Basic User

Hello,

I'm struggling with this one. I want to automatically send a report to a
group of people. I found the sendobject option to do this, but can't figure
out how to generate a report from the specific record that a user has just
updated. Any help is appreciated!
 
A

Arvin Meyer [MVP]

Build a report on the same data as the form. Then open it to the record that
your are on, after saving that record. On the button's click event you'll
want something like (air code):

Sub MyButton_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName",,,,"PrimaryKey =" & Me.txtPK
' email code for report.
End Sub
 
V

Very Basic User

This is a bit above me, can you explain in laymen terms?
--
Thank you for your time!
John


Arvin Meyer said:
Build a report on the same data as the form. Then open it to the record that
your are on, after saving that record. On the button's click event you'll
want something like (air code):

Sub MyButton_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName",,,,"PrimaryKey =" & Me.txtPK
' email code for report.
End Sub
 
A

Arvin Meyer [MVP]

I don't know which version you are using, but generally, you can right-click
on your form, and choose "Save as Report" then give the report a name and
open it to make whatever changes you need to (like changing the background
color to white)

If you're not sure what a Primary Key is, you'll need to read up on some
database terminology. May I suggest:

"Database Design for Mere Mortals" by Michael J. Hernandez
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Very Basic User said:
This is a bit above me, can you explain in laymen terms?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top