By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Is there a way of automatically emailing a form as it appears in access

100+
P: 119
Hi. If anyone can give me a quick pointer before I get involved in this, I would greatly appreciate it.

I would like to automatically email data from a form in Access. My ideal outcome would be an image of the form so that the recipient sees what I see in Access.

My suspicion, from what I have read (and experienced using DoCmd.SendObject), is that this is not possible. Rather, trying to email a form will output the whole underlying table in either text or excel format.

If a form cannot be emailed in the 'as seen' format, then my next approach would be to create a report, apply an appropriate filter, and then email that report in 'Snapshot Format'.

Does anyone have any views/suggestions on this that might be of help?
Mar 14 '07 #1
Share this Question
Share on Google+
13 Replies


100+
P: 119
I've been able to email reports using the 'Snapshot Format' of the DoCmd.SendObject command, with one slight problem.

To send the email I do the following:

Open report
Apply filter to report
DoCmd.SendObject

However, I find that unless I put a break in the code or insert a message box before calling the SendObject command the report is mailed without having had the report filtered.

Any ideas why that might be?
Mar 15 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Try this ...

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SendObject acSendForm, "FormName", acFormatSNP, "EmailAddress", , , "Subject", "Msg"
Mary
Mar 17 '07 #3

100+
P: 119
Thanks, Mary. Actually, that is the code I'm using to generate the report. My real concern is twofold:

- Is there a way of emailing a report/form other than using snapshot viewer (I'm dealing with Macs and Windows)
- Why the report does not filter correctly, unless I put a msgbox prompt between the filter and the DoCmd.SendObject command.
Mar 19 '07 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks, Mary. Actually, that is the code I'm using to generate the report. My real concern is twofold:

- Is there a way of emailing a report/form other than using snapshot viewer (I'm dealing with Macs and Windows)
- Why the report does not filter correctly, unless I put a msgbox prompt between the filter and the DoCmd.SendObject command.
When dealing with a form this is the only way I know of but someone else may have a better idea.

Not sure why the filter is causing a problem. Can you post the full code you are using.

Mary
Mar 22 '07 #5

100+
P: 119
When dealing with a form this is the only way I know of but someone else may have a better idea.

Not sure why the filter is causing a problem. Can you post the full code you are using.

Mary
Mary, I used a different approach in the end that worked. I would send you the code, but can't remember exactly what it was.
Mar 27 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
Mary, I used a different approach in the end that worked. I would send you the code, but can't remember exactly what it was.
No problem. Glad you got it working.
Mar 27 '07 #7

Denburt
Expert 100+
P: 1,356
You may take a look at the following commands instead of a msgbox. For more details check the VBA help file. :)

DoEvents
Yields execution so that the operating system can process other events.

DBEngine.Idle
Suspends data processing, enabling the Microsoft Jet database engine to complete any pending tasks, such as memory optimization or page timeouts
Mar 27 '07 #8

MMcCarthy
Expert Mod 10K+
P: 14,534
You may take a look at the following commands instead of a msgbox. For more details check the VBA help file. :)

DoEvents
Yields execution so that the operating system can process other events.

DBEngine.Idle
Suspends data processing, enabling the Microsoft Jet database engine to complete any pending tasks, such as memory optimization or page timeouts
Didn't know about the second one. I'll have to remember that. Should have thought of the first one though. It's the old age catching up with me.

Mary
Mar 27 '07 #9

Denburt
Expert 100+
P: 1,356
Didn't know about the second one. I'll have to remember that. Should have thought of the first one though. It's the old age catching up with me.

Mary
Wait in an earlier post you said you were still a spring chicken... Midlife kicking in? Maybe your just old enough to forget how old you are. ;)
Really, this forum is helping me out major I am remembering things that I had forgotten or atleast pushed into back of my head.
Mar 27 '07 #10

MMcCarthy
Expert Mod 10K+
P: 14,534
Wait in an earlier post you said you were still a spring chicken... Midlife kicking in? Maybe your just old enough to forget how old you are. ;)
Really, this forum is helping me out major I am remembering things that I had forgotten or atleast pushed into back of my head.
Depends on what kind of a day I've had. Today was an "I hate my clients and I don't want to be self employed anymore" kind of day. Most days I love it.

I know what you mean about retrieving info you forgot you knew.
Mar 27 '07 #11

100+
P: 119
DoEvents works a treat although, ironically, I also need the msgBox. At least I now have two ways to make it work!
Mar 28 '07 #12

Denburt
Expert 100+
P: 1,356
DoEvents works a treat although, ironically, I also need the msgBox. At least I now have two ways to make it work!
Awesome glad to have helped. I know exactly what you are saying Mary.
Mar 28 '07 #13

100+
P: 119
Awesome glad to have helped. I know exactly what you are saying Mary.
Denburt, have you seen my post about Access hanging?

http://www.thescripts.com/forum/thread623574.html

I am wondering whether it is caused by a similar issue....
Mar 28 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.