• Reports: Select and print multiple records (XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Reports: Select and print multiple records (XP)

    Author
    Topic
    #403749

    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!

    Viewing 1 reply thread
    Author
    Replies
    • #815755

      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.

      • #815761

        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?

        • #815767

          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.

          • #815846

            Dear Hans: (You know there’s trouble when I start out with “Dear…!)

            • #815854

              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.

            • #815866

              Well, I’m not into redesigning this beast today. grin 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!

            • #815867

              Well, I’m not into redesigning this beast today. grin 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!

            • #815855

              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.

          • #815847

            Dear Hans: (You know there’s trouble when I start out with “Dear…!)

        • #815768

          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.

      • #815762

        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?

      • #815778

        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…! salute

      • #815779

        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…! salute

    • #815756

      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.

    Viewing 1 reply thread
    Reply To: Reports: Select and print multiple records (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: