Email one page of a report based on a field value

G

Guest

I know there have been many questions posted regarding this, but need some
help to get started....any advice would be greatly appreciated!

I have a DB that tracks class registrations and need to e-mail each (there
are 60) supervisor with a list of their employees and when each is scheduled
to attend a class. There are multiple days of classes and each supervisor
will have some of their employees attend each day.

I already have the query and report set up using sorting/grouping, now just
need to know what to do next. I want the e-mail to go to the supervisor
listed at the top of the page. I know there is no quick/easy way to do this
- it looks like coding is the only way, but I need some help to get started
since I'm not familiar with coding. Do I need a form with command buttons?
If so, what is behind the button? Do I need a macro that loops through the
"supervisor" field?

I'm basically stuck...and really hoping somebody can help point me in the
right direction. The last time we did this project, we ended up
copying/pasting the information into e-mails which took so much time. Hoping
to make things a little more efficient this time around.

Thanks!
 
R

Rick B

I just answered an almost identiacal question. Se the post from today with
the subject "Email a report".
 
G

Guest

Thanks...the post from earlier today wasn't there when I started searching.
A few questions to help clarify.

On the form, was the EmployeeID field in a combo box? My equivalent will be
the Training Date.

Where does the "code" go? Behind the button? The only command buttons I've
created have been pretty simple - using the wizard, so this is new to me.

You mentioned you didn't have the code anymore - anywhere else online you
might suggest to get this? I don't think I can get this internally unless I
can learn how to code in the next few days...

Thanks again for your help...
 
R

Rick B

The employee was in a text box. It was the only field in the query upon
which the form was based.

The code did go behind the button.

The code pretty much said, email this report, advance the form to the next
record, repeat.

The report was build to limit the records produced based on the UserID in
the form's text box, so there was really no fancy coding there. Instead of
the user typing in the UserID, it pulled it from the form.

To get started, you could build the form with your date range and a field
for the supervisor. Enter those items and have the report produce for ONLY
those variables, then email that report to the supervisor listed.

To make it a bit closer, make that form based on a query or table that
contains the supervisors for which your report should be produced. Replace
your unbound textbox with the supervisor ID or name. NOW, the form will
show the first supervisor and you will enter the date needed. Leave the
form open, and run your report. Email it. Go back to the form and press
PAGE-DOWN to advance to the next supervisor. Leave it open and run your
report, then email it. etc.

The next step would be to automate the process of pressing page down, and
automate the process of emailing the report. If you use the button wizard,
it will walk your through opeing the report and limiting it to only the
supervisor currently being displayed on your form. You can then enhance
that code to advance the record and repeat.

Sorry I can't be more specific.
 

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