email the current record in a form

M

Maax

Hello all, I would like to send details of a new record created to a collegue
via email. Using a form i will create the new record and a few details such
as part number. I would then like to click a button on the form which would
email details of the new record as either a snapshot of the form or as a
report with the details i have just entered. I did already try the "mail
report" function but this only seems to email the first record in the
database and not the record that i am currently filling in and viewing on
screen.

Any help appreciated.
 
D

Damian S

Hi Max,

Have your report query pick up the ID of the currently viewed record like
this:

forms!FORMNAME.ID

That way when you open your report or email it there are no problems.

You can use the sendobject method to email a report like this:

docmd.SendObject acSendReport, "REPORT_NAME", acFormatSNP, "TO_FIELD",
"CC_FIELD", "BCC_FIELD", "SUBJECT_HERE", "MESSAGE_BODY", false

The false at the end says "email without waiting for me to click send".

Hope this helps.

Damian.
 
M

Maax

Hi Damian, thanks for help. Can you temm me where exactly i need to put the
forms!FORMNAMEID?

thanks
 

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