Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Report not showing some fields

    I am using

    Code:
    
      Dim strWhere      As String
      Dim ctl           As Control
      Dim varItem       As Variant
    
    
      'make sure a selection has been made
      
      If Me.lstCategory.ItemsSelected.Count = 0 Then
        MsgBox "Must select at least 1 employee"
        Exit Sub
      End If
    
    
      'add selected values to string
      Set ctl = Me.lstCategory
      For Each varItem In ctl.ItemsSelected
        strWhere = strWhere & ctl.ItemData(varItem) & ","
      Next varItem
      'trim trailing comma
      strWhere = Left(strWhere, Len(strWhere) - 1)
      'open the report, restricted to the selected items
    
    
      DoCmd.OpenReport "rptBookingEmailBatchPDF", acPreview, , "TeacherID IN(" & strWhere & ")"
      DoCmd.SendObject acSendReport, "rptBookingEmailBatchPDF", "PDFFormat (*.pdf)", Me.txtEmail, , , "Booking Confirmations", , yes
      DoCmd.Close acReport, "rptBookingEmailBatchPDF", acSaveNo
    for each individual school it shows the title of the schools on the correct fields however as I am batch emailing one pdf to the same person any person that has the same name and school (and school id) shows up blank on the second and following pages. When it goes back to a different school in the pdf the details show correctly.

    I am guessing because it is the same school I am getting blanks on the next pages - how do I get around this? I am guessing it is in the code?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    What does the report look like when you open it in Preview? The PDF should look just like that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Okay, here's my assumptions regarding your code -

    1) rptBookingEmailBatchPDF is a report based on a query that contains TeacherIDs.

    2) txtEmail is a control on the form that contains the email(s) you are sending the report to.

    3) lstCategory is a listbox where the boundcolumn is bound to values that correspond to TeacherIDs.

    Here's my questions about your problem -

    4) Do you mean that the values are not repeating in the new page headers, if those values have not changed? If so, the problem is the report header settings. Fix it there.

    5) Do you mean that entirely blank pages are showing up? If so, run the report without any filters, and see if the number of blank pages is the same as the number of values that were filtered out. If so, there is a mismatch between the filter method and the report itself, and the report is pagebreaking on omitted data. Post details and we'll debug.

    And a general note -

    6) Just for form's sake, I personally would add a space after the comma between TeacherIDs. That's unlikely to be the problem, but I've found versions of SQL where ", " is recognized as a list-dividing token and "," is not.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 16
    Last Post: 09-17-2013, 04:35 PM
  2. Replies: 1
    Last Post: 06-26-2013, 09:17 AM
  3. Replies: 4
    Last Post: 05-14-2012, 06:10 PM
  4. Report showing non-visible fields
    By AKQTS in forum Forms
    Replies: 2
    Last Post: 09-21-2010, 09:40 AM
  5. fields not showing up in Form view
    By eroy in forum Forms
    Replies: 3
    Last Post: 08-28-2010, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums