J
Jessica
Hello Everyone,
I am stumped and need help. I have a list box with the following code
but it would not allow multiple selctions to be viewed as reports. Mark
has suggested a SQL statement and has posted part of it to get me
started but I don't relly understand what the SQL statement is saying to
finish the rest of it. Below is the code I had that wouldn't allow
multiple reports to be viewed and below that is the code Mark suggested.
Any help would be greatly appreciated.
Thank you,
Jessica
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 11297", "06010 11588", "76808
52094", "76808 52138"
DoCmd.OpenReport "Barilla", acViewPreview, , "UPC = '" &
StrUPC & "'"
'preview report; change to acViewormal to print immediately
Case "41129 07764" To "41129 27463"
DoCmd.OpenReport "Classico", acViewPreview, , "UPC = '" &
StrUPC & "'"
Case "39400 01440" To "39400 01443"
DoCmd.OpenReport "Bush", acViewPreview, , "UPC = '" & StrUPC
& "'"
Case "64200 32716" To "64200 32723"
DoCmd.OpenReport "Classico Canadian", acViewPreview, , "UPC =
'" & StrUPC & "'"
Case Else
DoCmd.OpenReport "Others", acViewPreview, , "UPC = '" &
StrUPC & "'"
End Select
Next varSelectedUPC
End Sub
I am stumped and need help. I have a list box with the following code
but it would not allow multiple selctions to be viewed as reports. Mark
has suggested a SQL statement and has posted part of it to get me
started but I don't relly understand what the SQL statement is saying to
finish the rest of it. Below is the code I had that wouldn't allow
multiple reports to be viewed and below that is the code Mark suggested.
Any help would be greatly appreciated.
Thank you,
Jessica
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 11297", "06010 11588", "76808
52094", "76808 52138"
DoCmd.OpenReport "Barilla", acViewPreview, , "UPC = '" &
StrUPC & "'"
'preview report; change to acViewormal to print immediately
Case "41129 07764" To "41129 27463"
DoCmd.OpenReport "Classico", acViewPreview, , "UPC = '" &
StrUPC & "'"
Case "39400 01440" To "39400 01443"
DoCmd.OpenReport "Bush", acViewPreview, , "UPC = '" & StrUPC
& "'"
Case "64200 32716" To "64200 32723"
DoCmd.OpenReport "Classico Canadian", acViewPreview, , "UPC =
'" & StrUPC & "'"
Case Else
DoCmd.OpenReport "Others", acViewPreview, , "UPC = '" &
StrUPC & "'"
End Select
Next varSelectedUPC
End Sub