Results 1 to 6 of 6
  1. #1
    jwill is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67

    Docmd.OutPutTo giving me the wrong data

    Hello everyone. When I use Docmd.OutPutTo it is giving me the wrong data (see image)
    Views: 3 Size: 8.8 KB">7-18-2014 5-12-08 PM.pdf
    AND 7-18-2014 5-13-18 PM.pdf

    Here is the code

    Here is the function
    Code:
     Public Function export_rpt(var_Rpt_Name As String)
    On Error GoTo Err_handler
    
    DoCmd.OutputTo acReport, var_Rpt_Name
     
    Exit_export_rpt:
        Exit Function
    Err_handler:
        If Err.Number = 2501 Then
            Err.Clear
        Else
            MsgBox "Error number " & Err.Number & ": " & Err.Description
            Resume Exit_export_rpt
        End If
    End Function
    Here is the call

    Code:
    Private Sub export_lbl_Click()
    Call export_rpt(Me.Name) 'features module
    End Sub
    on the excel spreadsheet the data starts to repeat w/ inaccurate data at the fourth row and I have no idea why. On top of that, when I go to the print preview view in the report and right-click and export that way, I get the correct data . I've already compacted and repaired and I've already transferred objects into a new db. This is an issue that has been going on for about 5 -6 months now. Any suggestions?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What type of object do you have open when you are calling the function, form, report?

    The object you call the function from has the same name as the object being exported?

  3. #3
    jwill is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67
    The object is the report itself. I click on a label on the report to export it. I just set it up like this so I can reuse it on other reports

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would suggest exporting a query object or maybe trying to export another instance of the report. If attempting the latter, suggest simply copying and pasting report object with another name and using the pasted object with new name as object to export.

  5. #5
    AnandKhinvasara is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2014
    Posts
    31
    Its hard to tell whats wrong until you share the db. Check for filters and grouping in report. Check for any property setting changed that shouldnt have.

  6. #6
    jwill is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67
    Sorry for the last response and thanks for your replies...

    @itsme - I will try that and let you know

    @AnandKhinvasara - The info shows correctly in the report and my export label doesn't change any properties.

    This really looks like it may be an Access bug. I don't have a chance to get to it yet, but I will let u all know if I figure it out.

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

Similar Threads

  1. DoCmd.OutputTo question
    By mkc80 in forum Access
    Replies: 5
    Last Post: 10-16-2012, 07:11 PM
  2. DoCmd.OutputTo acOutputReport
    By GraeagleBill in forum Reports
    Replies: 11
    Last Post: 09-15-2012, 07:33 PM
  3. DoCmd.OutputTo
    By tylerg11 in forum Reports
    Replies: 2
    Last Post: 08-09-2012, 12:22 PM
  4. DoCmd.OutputTo not working
    By arunkumar213 in forum Access
    Replies: 1
    Last Post: 09-08-2011, 10:41 PM
  5. AcFormat in DoCmd.OutputTo
    By SIGMA248 in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 08:50 AM

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