How to send the current record of the form via email

I

Irshad

I want to send the current record of my form via email. Therefore, I would
like to add a command button and on that click event code to do it.

Could any of the professional can advise this.

regards
 
P

Piers 2k

Below is part of an example that I use in class to teach delegates the DoCmd
feature. You can create a loop to automatically go through all items on the
form, but visually, it won't look as good as you might want.

The vbCRLF is a carriage-return; an enter, in other words. The only two
fields I've used are the FirstName and HowOld fields.

Try typing in the DoCmd.SendObject yourself and use the hints, if you've
not come across them before.

Hope this helps,

Piers

' Send a Happy Birthday e-mail to current employee with

' congratulatory text

' Remember to specify the type of variable

Dim Subject, Body As String



' Create Subject and Body of e-mail, using FirstName and HowOld fields

Subject = "Happy Birthday"

Body = "Hi there " & FirstName & vbCrLf & _

"Congratulations on reaching " & HowOld & " years young!" & vbCrLf & _

vbCrLf & _

"Well done!" & vbCrLf & _

"The Management."



' e-mail SendObject

DoCmd.SendObject , , , , , , Subject, Body
 

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