Results 1 to 11 of 11
  1. #1
    ecpike is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15

    Fields not printing

    Hi Everyone,


    I have a form which the user is to fill in all the fields and then push a command button to print a report which prints out the information just entered. What's happening now is that when I try to print with the command button, not all of the information is being printed. The form has a tab control and the command button is on the last tab, so I moved it off of the tab control but nothing printed. I moved it back on to the tab control and again, only a little of the info printed. When I go to a different record and then come back, it all prints using the command button. Any advice? Let me know if that needs more explanation.

    Thanks, Eric

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Forms are for interaction with the user and Reports are form printing. Do you have a report you can print with the button?

  3. #3
    ecpike is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15
    Yes, there is a form they enter info on and a report that prints (which is gets its info from a query based on the form).

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you save the data on the form *before* printing?
    If Me.Dirty Then Me.Dirty = False

  5. #5
    ecpike is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15
    No, I don't have that... Where would I put the code?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you using a macro or the click event of the command button to print the report? Whichever you are using can you post it some how so I can see it?

  7. #7
    ecpike is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15
    Here is the code for the command button which prints the report:
    Code:
    Private Sub PrintEReport_Click()
    On Error GoTo Err_PrintEReport_Click
        Dim stDocName As String
        stDocName = "Event Report"
        DoCmd.OpenReport stDocName, acNormal
    Exit_PrintEReport_Click:
        Exit Sub
    Err_PrintEReport_Click:
        MsgBox Err.Description
        Resume Exit_PrintEReport_Click
    End Sub
    I used this thread
    https://www.accessforums.net/reports...eport-942.html
    to create the query and report to print out the current form's information.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Change the code to look like this:
    Code:
    Private Sub PrintEReport_Click()
    On Error GoTo Err_PrintEReport_Click
        If Me.Dirty Then Me.Dirty = False
        Dim stDocName As String
        stDocName = "Event Report"
        DoCmd.OpenReport stDocName, acNormal
    Exit_PrintEReport_Click:
        Exit Sub
    Err_PrintEReport_Click:
        MsgBox Err.Description
        Resume Exit_PrintEReport_Click
    End Sub

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    BTW there is an easier way to filter the report. You can use the WhereCondition argument of the OpenReport command.

  10. #10
    ecpike is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    15
    Perfect! Works like a charm. Thanks for all of your help!

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I find the filters for reports work rather well so I create reports from a generic query that selects all of the records and then apply the filter with as I said earlier, the WhereCondition argument of the OpenReport command. If you want, duplicate the report query and remove the criteria. Then let me know what that criteria was and I'll show you the OpenReport line.

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

Similar Threads

  1. Help with my printing
    By mattwill2001 in forum Queries
    Replies: 4
    Last Post: 08-17-2009, 01:55 AM
  2. printing issues
    By dmmartin in forum Programming
    Replies: 2
    Last Post: 05-29-2009, 08:22 PM
  3. Report Printing Error
    By gjohnson71 in forum Reports
    Replies: 4
    Last Post: 03-07-2009, 12:36 PM
  4. Printing all tabs on one form
    By sshafer1 in forum Access
    Replies: 0
    Last Post: 12-06-2007, 07:47 PM
  5. Printing Reports....
    By Danny Christie in forum Reports
    Replies: 1
    Last Post: 12-06-2006, 05:51 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