Interrupting Code

J

JimP

I have code that that loops through a table of customers and opens up the
same report for each customer in preview mode.

Is there a way that I can interrupt the code to decide what to do with each
customer's report before previewing the next customer's (e.g. print, save to
PDF, email).

Opening the report as a dialog report will interrupt the code, but I don't
seem to be able to move the focus to a toolbar or form to carry out the
desired action.
 
T

Tony Toews [MVP]

JimP said:
I have code that that loops through a table of customers and opens up the
same report for each customer in preview mode.

Is there a way that I can interrupt the code to decide what to do with each
customer's report before previewing the next customer's (e.g. print, save to
PDF, email).

I'd suggest setting up a continuous form based on the same recordset
as the loop in your code. Then decide on what you are going to do
using a number of command buttons on each line of the form. Also
display the last date "actioned" on the continuous form. This way if
you get interrupted on the continuous form you know where to start up
again.

I'd also suggest recording the action you took in a table. So if the
customer ever queries it you can state "I mailed that on ..." or "I
emailed it to (e-mail address removed)" etc. If you choose to do this then
rather than putting a last date "actioned" on the continuous form I'd
create an append query in that history table with an empty action
date. Then open the continuous form and decide what you want to do
with each persons report.

Now wouldn't you create the PDF report and then email it immediately?
If so you can combine that into one step. I'd suggest using Lebans
free code to do this.

A2000ReportToPDF is an Access 2000 database containing a function to
convert Reports and Snapshot files to PDF documents. No PDF Printer
driver is required.
http://www.lebans.com/reporttopdf.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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