Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show a user's name on each instance of a printed report.

Status
Not open for further replies.

cwhite23

Technical User
Sep 17, 2003
66
US
OK, I'm stumped.

Currently, I have a VB module that goes through and prints out several weekly reports for our supervisors in order by department. What I need to do is to show the supervisor's name on each report as they print. The same report may go to several different people, but the names must be unique for each of them.

Any ideas?

Thanks!
 
I am not quite sure what you are asking.

Environ("Username")

Will return the windows log-in name, for the most part.

CurrentUser

Will return the Access log-in name: Admin, unless you have security.
 
Remou - That's what I thought at first too. I think that cWhite 23 is looking to customize reports so that the recipients name is on each one.

cWhite23 -

AFAIK, You are going to need to do something like this.

First, create a table that contains all manager names and reports they recieve.

From this table you will need to create two recordsets. First recordset = Managers names.

You will loop through this recordset one at a time.

First step is to create a second recordset containing all reports for the manager in question.

Then you can loop through this recordset, modifying the reports (you can do this by opening them in design view) to include the manager's name somewhere. Also, append something to the caption so that they have different file names once printed (you said one report could go to several managers). Once they have been modified, print the report and move on to the next.

As you can see this is not going to be a trivial task. I would not think it is worth the time, but I don't know your environment.

A better idea would be to have them print their own reports, using the tip remou gave to include their name on it.

Anyway, if you are not familiar with recordsets and while loops, you will be by the time you are done with this ;-)

Good Luck,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Thanks Alex.

You hit the nail on the head. This is exactly what I'm looking to do. The database that I've created is an MRP system. Each Monday morning, we print a packet of production reports for each of our supervisors. This is where the names come in. We have had trouble in the past with some of our reports making their way to the outside world. This way, we can tell who the reports were printed for and who released them.

We would rather not have the end users print their own reports, especially since most of them are not computer-sapient.

I'll give this a shot tomorrow and see how it works. Thanks again!

Charles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top