Printing multiple reports per ID

J

Johnny Polite

Hello,

I am trying to figure out how to print multiple reports per ID ("Username",
text field). I guess it would be like packets of reports. I am passing
values to the report through the Where statement that I obtain by looping
through a multiselect listbox ending up with a string resembling:

[Username] IN ("Value1", "Value2", ...)

I imagine I have to loop through the reports as I loop through the
Usernames. I just can't sort it out in my head.

Appreciate the help in advance.

-Chris
 
R

Rob Parker

Well, it depends a bit on exactly what you want. If the print order doesn't
matter, simply open each of the reports in turn using your constructed Where
statement:
...
DoCmd.OpenReport "Report1", ....
DoCmd.OpenReport "Report2", ....
...

But since you're asking, this is probably not what you want, and you're
needing to print all the reports for each user, and then move to the next
user. In that case, you'll need to loop through your listbox selections and
open each report for that user, with the Where condition being the single
username in the listbox selections loop (rather than using that loop to
build Where condition).

HTH,

Rob
 
J

Johnny Polite

Ahh. Yes. That makes sense. Instead of building a string through the loop,
I can just roll out a list of OpenReport commands for each value. Nice.

I am a novice at this stuff. Started teaching myself about a month ago.
It's just a little bit addicting. It's weird how you can get on such a roll
and then something trips you up because ya just can't wrap your brain around
it.

Anyway, I really appreciate it, Rob. Thanks.

Rob Parker said:
Well, it depends a bit on exactly what you want. If the print order doesn't
matter, simply open each of the reports in turn using your constructed Where
statement:
...
DoCmd.OpenReport "Report1", ....
DoCmd.OpenReport "Report2", ....
...

But since you're asking, this is probably not what you want, and you're
needing to print all the reports for each user, and then move to the next
user. In that case, you'll need to loop through your listbox selections and
open each report for that user, with the Where condition being the single
username in the listbox selections loop (rather than using that loop to
build Where condition).

HTH,

Rob

Johnny Polite said:
Hello,

I am trying to figure out how to print multiple reports per ID
("Username",
text field). I guess it would be like packets of reports. I am passing
values to the report through the Where statement that I obtain by looping
through a multiselect listbox ending up with a string resembling:

[Username] IN ("Value1", "Value2", ...)

I imagine I have to loop through the reports as I loop through the
Usernames. I just can't sort it out in my head.

Appreciate the help in advance.

-Chris
 
R

Rob Parker

You're welcome.

It'll get more addictive, and you'll occasionally wonder why you bother, and
you'll also learn to love these groups.

Enjoy,

Rob
Johnny Polite said:
Ahh. Yes. That makes sense. Instead of building a string through the
loop,
I can just roll out a list of OpenReport commands for each value. Nice.

I am a novice at this stuff. Started teaching myself about a month ago.
It's just a little bit addicting. It's weird how you can get on such a
roll
and then something trips you up because ya just can't wrap your brain
around
it.

Anyway, I really appreciate it, Rob. Thanks.

Rob Parker said:
Well, it depends a bit on exactly what you want. If the print order
doesn't
matter, simply open each of the reports in turn using your constructed
Where
statement:
...
DoCmd.OpenReport "Report1", ....
DoCmd.OpenReport "Report2", ....
...

But since you're asking, this is probably not what you want, and you're
needing to print all the reports for each user, and then move to the next
user. In that case, you'll need to loop through your listbox selections
and
open each report for that user, with the Where condition being the single
username in the listbox selections loop (rather than using that loop to
build Where condition).

HTH,

Rob

message
Hello,

I am trying to figure out how to print multiple reports per ID
("Username",
text field). I guess it would be like packets of reports. I am
passing
values to the report through the Where statement that I obtain by
looping
through a multiselect listbox ending up with a string resembling:

[Username] IN ("Value1", "Value2", ...)

I imagine I have to loop through the reports as I loop through the
Usernames. I just can't sort it out in my head.

Appreciate the help in advance.

-Chris
 

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