Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003

    Unanswered: Simple report problem

    Hello all! I hope everyone had a very Merry Christmas!

    I have a report that gets fed Employee data from the following code:

        strDocName = "Graph - Lease Assignment"
        Set First = Me!lstLA_PR
        If First.MultiSelect > 0 Then
        If First.ItemsSelected.Count > 0 Then
        For Each varItem In First.ItemsSelected
        strOut = strOut & "," & Chr(34) & First.ItemData(varItem) & Chr(34)
        Next varItem
        strOut = Mid(strOut, 2)
        strOut = "In(" & strOut & ")"
        MsgBox "Please make a selection!"
        Exit Sub
        End If
        End If
        strWhere = "(" & "([Employee])" & strOut & ")"
        DoCmd.OpenReport strDocName, acViewPreview, , strWhere

    Odd thing is, if you select more than 1 name from the list box, it will bring up the first person selected fine, but after that it flips out. If i only select 1 name, it will bring up one page with good data, and 7 pages of nothingness.

    Another example: If I select 3 names, it will bring up the first person fine, but there will be 23 pages of nothing behind it.

    There are 8 names on the list... so it must be running thru each one and pulling nothing... possibly?

    Any ideas?
    Last edited by Sucoyant; 12-26-03 at 09:26.

  2. #2
    Join Date
    Sep 2003
    What is this code supposed to generate anyways? I see it concating from a listbox then lopping off the 1st 2 characters then encapsulating that within an IN keyword ... This is a filter?

    Since it looks to be a filter, the report you apply it against, does the recordset support it? How did you create this report? What does it run on? Table? Query? Do it in code?

Posting Permissions

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