Results 1 to 8 of 8
  1. #1
    REAbernathy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    46

    Trying To Print The Current Record in Access in 2007 from a Report

    I am trying to allow the user to e-mail the form to the client but before that's done they need to make sure the user reviews the form before they e-mail it. Also I only want the Current record to be viewed by using a Print Review command button on the form. When i click on the button i get a Blank Page. Here is the code that I am using. Attached is a copy of my database. Thanking you for any assistance that you can give me.



    Private Sub Preview_Reports95_Click()
    Dim strDocName As String
    Dim strWhere As String
    strDocName = "TrackingSystemReport3"
    strWhere = "[ID]=" & Me!ID
    DoCmd.OpenReport strDocName, acViewPreview, , strWhere
    End Sub

    Also if you see any other issues with my code please feel free to let me know. I am very new and raw to Access.
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It's working for me. You're aware that the first page is blank?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I tested your procedure. The report opens and shows all records for ID 198 on 59 pages, starting on second page. Why is the Detail Section so large? It is working as designed so what do you want it to do? If you want only one record to show then need unique criteria, like the NumberOfAccounts field.

    I notice that not every record has a value selected in each of the listboxes, including the customer.
    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.

  4. #4
    REAbernathy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    46
    Thanks Super Moderator and Pbaldy so much guys for your quick response. So if it's working for you guys then how do I get rid of that blank first page and also why aren’t my heading showing up like on my form? Super Moderator when you say Detail Section I am sorry but I don’t know what you are talking about. And yes I am aware of some of the records are missing that was done on purposes. Super Moderator and Pbaldy what suggestions would you guys make so that the program would run more efficiently and look better? I am new to Access so if i say something that sound stupid then that's why.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Don't have it in front of me, but check the Force New Page settings of the date header.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The Detail Section is section of report (or form) that has detail data. In your case it has the fields AssignedTo, Agreements, etc. The height is set at 2.7604" and you have a textbox for NumberOfAccount at the bottom of the section. That creates a lot of white space but does seem to make sure each record has the same amount of space for data display.

    You have an OpenedDate group but no data in the group header, just two label controls.

    I changed the OpenedDate group header ForceNewPage property to none and the records start on first page. You might instead want the ForceNewPage set for the group footer.

    You have an EmbeddedMacro for the PrintReport button but no criteria is in the macro code so the report wants to print EVERYTHING.

    Odd, the headers show in Layout and Report views but not PrintPreview nor when printing. This I don't understand. So I created a new report and did copy/paste of all controls. Now the headers show in PrintPreview. I can only suggest that the original report is corrupted and solution is to rebuild as I did.
    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.

  7. #7
    REAbernathy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    46
    Ok...I will make these changes and send you a copy of what I have done but also my next problem is now i want to e-mail the current record that we just reviewed. How do i go about doing that? I have a command button on my form and after reviewing the current record i want to send it via e-mail. Thanking you for any assistance that you can give me.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Generally if you open the report filtered in Preview mode and then use SendObject to send it, you'll get the filtered report. Another method I usually use is to filter the report from within:

    Emailing a different report to each recipient

    If you're sending out several, this avoids the overhead of opening/closing the report constantly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Print Report from Current Record
    By hnkford in forum Reports
    Replies: 15
    Last Post: 05-22-2015, 08:08 AM
  2. Replies: 1
    Last Post: 03-26-2012, 03:01 PM
  3. Print current record to a report
    By drawc in forum Access
    Replies: 2
    Last Post: 01-15-2012, 12:48 AM
  4. Replies: 5
    Last Post: 10-26-2011, 02:59 PM
  5. Replies: 5
    Last Post: 09-22-2011, 02:10 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