Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372

    Me neither. Have used it for multiple assignments to variables to condense things on fewer lines, but never as method parameters. Didn't know this would allow anyone to omit parameters either. Or does it? No answer yet as to what the fix was.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Yes, can eliminate parameters. Tried it. It works.

    Code was moved from beginning to end of procedure:

    Code:
        DoCmd.OpenReport ReportName:="rptMonthlyCircleLog", View:=acViewPreview, _
            WhereCondition:="ID=" & Me.ID
        Exit Sub
    
    ErrHandler:
        ' Don't show error message if report was canceled
        If Err <> 2501 Then
            MsgBox Err.Description, vbCritical
        End If
    In its place:
    DoCmd.OpenReport "rptMonthlyCircleLog", acViewPreview, , "ID = " & ID

    Line removed: On Error GoTo ErrHandler

    Although doesn't explain why was not opening filtered before. And how did it even hit the Outlook code with that Exit Sub there? Was the posted code the actual code?

    Why retain the second OpenReport line?
    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 04-30-2014, 09:40 PM
  2. Replies: 1
    Last Post: 07-25-2013, 01:20 PM
  3. Replies: 2
    Last Post: 05-10-2013, 03:37 PM
  4. how to filter the Report
    By ismailkhannasar in forum Reports
    Replies: 2
    Last Post: 02-05-2013, 07:41 PM
  5. Report Filter
    By SFC in forum Reports
    Replies: 4
    Last Post: 01-11-2012, 04:13 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