Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Reports: Select and print multiple records (XP)

    I have a report (we call it a "training plan") that lists all the courses an employee/student must complete. (Our students are manufacturing employees.) Via parameter query, we select the one student whose training plan we wish to print. A parameter box pops up and asks the user to enter the student's PID (payroll ID). Then the report opens in Preview and we go through the usual steps to print the report on paper. To print another training plan, we have to repeat those steps.

    From time to time, we need to print a training plan for more than one student. At this moment, I need to print 35 new training plans! I'd like to devise a way for the user to select more than one training plan for printing. What a time-saver that would be! Can anyone suggest how I can make this happen? I'm sure I haven't furnished enough details, but I'm not sure what information might be pertinent. Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Select and print multiple records (XP)

    Lucas, it depends a bit on how your PIDs are structured. A relatively simple way would be as follows:
    - Remove the parameter for the PID field in the query.
    - Add a column: InStr([Enter PIDs separated by commas],[PID])
    - Clear the Show check box for this column.
    - Set the criteria to >0
    This will not work correctly if the PID of one student could be contained in the PID of another one, say that you have PIDs S01 and S012.

    For a more advanced solution, see Method 2 in MSKB article ACC2000: How to Create a Parameter In() Statement (the method I described above is Method 1)

    For a more user-friendly solution, you could provide an unbound form with a multi-select list box in which the user can click the PIDs or names of the students for whom a training plan must be printed, and an OK button whose On Click event procedure assembles the Where-condition for the report. Post back if you want to do that.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Reports: Select and print multiple records (XP)

    Hello again, Hans! Thanks for the quick response!

    Re: the first idea, all my PIDs are 4- or 5-digit numbers (e.g., 3739, 3753). The examples I chose show that we often see PIDs that have the same two digits appearing in sequence, but we don't have anything that matches exactly the example you gave. Will I have a problem with numbers such as these two?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Select and print multiple records (XP)

    Lucas, there would be a problem if you had 5-digit PIDs whose first 4 or last 4 digits match 4-digit PIDs, say 23456 and 2345, or 23456 and 3456. For if you entered 2345 as one of the PIDs in the first method, ALL PIDs that start with 2345 or end with 2345 would be selected. It doesn't matter if 2 or 3 digits match.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Reports: Select and print multiple records (XP)

    Thanks, Hans. I do have employees with 5-digit PIDs, but as luck would have it, I'm not printing training plans for any of those folks. So I'm gonna try Method 1 today. Then I'll study Method 2. The user-friendly approach has my attention, but right now I'm looking for the quick fix. I'll probably be back...! <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Reports: Select and print multiple records (XP)

    Dear Hans: (You know there's trouble when I start out with "Dear...!)

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Select and print multiple records (XP)

    Hmm, this would probably require you to redesign the report from the ground up, with a main report containing student info and a subreport containing training course info, linked to the main report by PID. For the moment it is probably easier to restore the original situation and print the training plans one by one. If you need to do this frequently, it could be worth while to redesign the report if and when you have time.

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Reports: Select and print multiple records (XP)

    Well, I'm not into redesigning this beast today. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> I've already reset the query, and I'm printing even as we speak.... I've got some other problems with this query and report, but it's Friday. Maybe next week.

    Thanks for taking the time to look at this!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •