Pass query snapshot to report?

A

Angela

When my database opens, it checks to see if any employees have had their
safety training expire using a query. If some expired it displays a form
(based on a snapshot of the same query) that lists those employees. After
the form opens, the sub programming continues those records are subsequently
changed to reflect the change in the employee status. As a result, the same
query would not again pull up those records after the form is displayed.

On the form that displays the list of employees, I would like the user to be
able to print a report of the list. However, by the time they click the
Print button (which would then pull up a report based on the same query as
the form), the records have changed so the report is empty. Is there any way
to 'save' the snapshot of the query used for the form so it can be used for
the report, or pass it to the report from the form?

Thanks
Angela
 
G

GB

May not be the answer to the question asked, but I would open a form that
contains the data that you would like to print as a report so that you can
control the background program (i.e., not have it run away and change the
data.) From there you could use a click to print button, or click to show
form and open a print dialog as well, or something like that.

I've also been meaning to look into it, but might look up the difference
between a window being modal or not, this might allow the code to stop
running forward as a result of being the only object allowed to be
"open"/worked on at the time. Long time ago I knew the difference and
impact, but haven't used it recently.
 
A

Angela

Thanks for the reply, GB. I was hoping to avoid passing the results of the
query to another table (or whatever) for the form to display. Another option
would perhaps be to generate the report right away, either in lieu of the
form (which isn't a great option) or maybe in the background. I was hoping
there was an easier way.
 
G

GB

There may be, and I apologize for not having spent the time necessary to
determine what it would be. Hopefully if the question is still open, then
someone with a little more experience would be able to provide a smoother
method of accomplishing your goal.
 
A

Angela

I came up with a solution that works. At the time I create the form to
display the info, I also create the report but set visible=false. If the
user clicks "create report", then the report becomes visible. It seems to
work pretty well. There might be other and better ways of accomplishing this
task, it would be nice to hear from a few of the experts. I appreciate your
time, GB!
 

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