Form Data Sent as E-mail Using a Report

  • Thread starter Thread starter virtualkeeper via AccessMonster.com
  • Start date Start date
V

virtualkeeper via AccessMonster.com

Hello all,

I've been scouring the posts here all day and can not come up with an answer
that I can implement.

Here's the rundown:

The form PurchaseRequest saves data to a table when the Submit button is
clicked. I have a query PurchaseRequestQuery that feeds the report Purchase
Request when the report is opened.

All of them work fine apart from each other however I'd like to e-mail the
last record defined by the field PurchaseRequestID from the report as a
snapshot when the user clicks the forms' Submit button.

I've tried several send options and such but haven't had any luck. I get
errors that say I can't run something when another isn't open, etc. I've come
close but had all the records sent and have since just backtracked to get
everything working again after several no-go's.

Can someone help a frazzled dude get this straight? All help is appreciated
in advance.

Later,

Darrin
 
In case anyone searches and needs the solution to this question, here is what
I did after taking a break and going back and working through it step by step.


1. Set up a macro that fires off using the After Insert property on the
originating form and name it what you'd like.
2. In the macro, have it open the query sorted ascending in the main ID field.
In the criteria setting of the Autonumbered (main) ID field
(PurchaseRequestID here) set it to receive the data from the form using
[Forms]![PurchaseRequest]![PurchaseRequestID].
3. Set the same macro to open the report, which here is PurchaseRequest.
4. Set the same macro to close the query.
5. In the same macro, use the SendObject to send the the report in a snapshot
format. Note: Other users will need to have a snapshot viewer or Access
installed to view the report. Viewer should be free from Microsoft, not sure.
6. Set the same macro to close the report.
7. Set the same macro to close itself using Close Macro.

I'm sure there are coding ways to do the same thing and may even be errors in
what I've found but take it step by step, check the output after each
addition to the macro and it should work.

If anyone sees any potential problems, please let me know. This is just one
of probably twenty solutions.


Hello all,

I've been scouring the posts here all day and can not come up with an answer
that I can implement.

Here's the rundown:

The form PurchaseRequest saves data to a table when the Submit button is
clicked. I have a query PurchaseRequestQuery that feeds the report Purchase
Request when the report is opened.

All of them work fine apart from each other however I'd like to e-mail the
last record defined by the field PurchaseRequestID from the report as a
snapshot when the user clicks the forms' Submit button.

I've tried several send options and such but haven't had any luck. I get
errors that say I can't run something when another isn't open, etc. I've come
close but had all the records sent and have since just backtracked to get
everything working again after several no-go's.

Can someone help a frazzled dude get this straight? All help is appreciated
in advance.

Later,

Darrin

--
Later,

Darrin

Message posted via AccessMonster.com
 
Back
Top