report question

J

Jessica

Hello All,

I have a forn that list several items in a field from a table. Is there a
way when selecting two or more items in the list that use the same report to
open a report for each item. As of now when I select two or more items
unless the reports are different it only shows a report of the first item
selected.

FYI Each item must have its own report.

TIA,
Jess
 
G

Guest

I don't have the answer for your question, but incase no body does then you
can try and print the report when filtering for all the Items and have a page
break after each item.
 
J

Jessica

Hello,

This is part of the code that I have that only shows the first record
selected when more than one record is selected using the same report.

Private Sub Preview_Click()
Dim varSelectedUPC As Variant
Dim StrUPC As String

For Each varSelectedUPC In UPC.ItemsSelected
StrUPC = UPC.ItemData(varSelectedUPC)
Select Case StrUPC
Case "06010 11292" To "06010 11588", "76808 52094", "76808 52138",
"95059 00046" To "95059 00051"
DoCmd.OpenReport "Barilla", acViewPreview, , "UPC = '" & StrUPC & "'"

If I replace acViewPreview with acViewormal it prints both records
seperately even though they use the same report (which is what I want). If
that works then why aren't I able to view more than one record if they both
use the same report?


Thank you,
Jess
 
V

Van T. Dinh

The details for the second Record may be on the second (or later) pages of
the Preview.

Did you note the "Page X of {Total Pages}?

Clcik the next page arrow or PageDown key and see what happens.

HTH
Van T. Dinh
MVP (Access)
 
G

Guest

Try that instead

Private Sub Preview_Click()
Dim varSelectedUPC As Variant
Dim StrUPC As String
Dim MyFilter as string

For Each varSelectedUPC In UPC.ItemsSelected
StrUPC = UPC.ItemData(varSelectedUPC)
Case "06010 11292" To "06010 11588", "76808 52094", "76808 52138",
"95059 00046" To "95059 00051"
MyFilter = "'" & StrUPC & "',"
next
DoCmd.OpenReport "Barilla", acViewPreview, , "UPC = in (" &
left(MyFilter,len(MyFilter)-1 & ")"

that will print one report with all the items, you need to have in your
report a page break after each item.
 

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