Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Not sure if this will work, but open your report in design view. In properties, look for a property Filter on Load. If that is set to No, change it to Yes, and try running the report.



    If that does work, then IMO, that is not one of Microsoft's more brilliant changes, as it causes a lot of DoCmd.Openreport statements not to work as they used to.

  2. #17
    nrypka is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2016
    Posts
    11
    Unfortunately it did not work

  3. #18
    nrypka is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2016
    Posts
    11
    I got it to work using some of Allen Browne's code

    Code:
     
     Dim strWhere As String
        If Me.Dirty Then    'Save any edits.
            Me.Dirty = False
        End If
    
        If Me.NewRecord Then 'Check there is a record to print
            MsgBox "Select a record to print"
        Else
            strWhere = "[ID] = """ & Me.[ID] &"""
            DoCmd.OpenReport "MyReport", acViewPreview, , strWhere     End If

  4. #19
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What exactly is in strWhere?
    You should get in the habit of doing a debug.print strWhere to know the value of your OpenArgs.

    Show us some code.

    OOOoops: Seems you posted while I was typing/thinking.
    Glad you have it working. ID is not usually text.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-24-2014, 04:34 PM
  2. Replies: 2
    Last Post: 03-04-2014, 06:46 AM
  3. Replies: 6
    Last Post: 01-24-2014, 07:57 AM
  4. Doing a search in a blank form
    By Access_Novice in forum Forms
    Replies: 2
    Last Post: 12-04-2013, 10:07 AM
  5. Replies: 15
    Last Post: 08-30-2012, 04:16 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