Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: email current record from a form

Geek News

email current record from a form
SylvieB 11/11/2008 9:43:02 PM
Hi all
I need help with the following. From a button on the form, the user would
click on it and be able to email the record he's looking at as an attachment.
I just need Outlook to display and the user can fill out the recipient's
email address himself. How do I do that?
thank you very much anyone for any help you can provide.
Re: email current record from a form
"Scott Lichtenberg" <donot[ at ]reply.com> 11/11/2008 10:09:55 PM
Sylvie,

There are two issues here. The first - emailing from Access - is relatively
easy. Look at the help text for the SendObject command. You can send a
form with the acSendForm option. The code below will do the trick.

DoCmd.SendObject acSendForm, Me.Name

However, there is a catch. The SendObject command will convert and output
all records in the form's recordsource. If you are browsing through a form
with 500 records, all of them will be sent. The way around this is to use
the Filter and FilterOn properties. By filtering your form so that it shows
only one record, you can then email just the one record.

Me.Filter = "KeyField = " & Me!KeyField
Me.FilterOn = True
DoCmd.SendObject acSendForm, Me.Name
Me.FilterOff = True

Hope this helps.



"SylvieB" <SylvieB[ at ]discussions.microsoft.com> wrote in message
news:A7BBC1D4-04AD-4230-8CA4-B76FF5D813AE[ at ]microsoft.com...
[Quoted Text]
> Hi all
> I need help with the following. From a button on the form, the user would
> click on it and be able to email the record he's looking at as an
> attachment.
> I just need Outlook to display and the user can fill out the recipient's
> email address himself. How do I do that?
> thank you very much anyone for any help you can provide.

Re: email current record from a form
SylvieB 11/12/2008 4:09:01 PM
Thank you so much Scott. Yes, your code works; Your help is greatly
appreciated.
Have a great day!


"Scott Lichtenberg" wrote:

[Quoted Text]
> Sylvie,
>
> There are two issues here. The first - emailing from Access - is relatively
> easy. Look at the help text for the SendObject command. You can send a
> form with the acSendForm option. The code below will do the trick.
>
> DoCmd.SendObject acSendForm, Me.Name
>
> However, there is a catch. The SendObject command will convert and output
> all records in the form's recordsource. If you are browsing through a form
> with 500 records, all of them will be sent. The way around this is to use
> the Filter and FilterOn properties. By filtering your form so that it shows
> only one record, you can then email just the one record.
>
> Me.Filter = "KeyField = " & Me!KeyField
> Me.FilterOn = True
> DoCmd.SendObject acSendForm, Me.Name
> Me.FilterOff = True
>
> Hope this helps.
>
>
>
> "SylvieB" <SylvieB[ at ]discussions.microsoft.com> wrote in message
> news:A7BBC1D4-04AD-4230-8CA4-B76FF5D813AE[ at ]microsoft.com...
> > Hi all
> > I need help with the following. From a button on the form, the user would
> > click on it and be able to email the record he's looking at as an
> > attachment.
> > I just need Outlook to display and the user can fill out the recipient's
> > email address himself. How do I do that?
> > thank you very much anyone for any help you can provide.
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net