Results 1 to 5 of 5
  1. #1
    Seamus59 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    34

    Three buttons launch my report, can the report know which and put it in the Title?

    I have one report called by three different buttons with macro actions that have different "where" clauses. I'd rather not duplicate the report and change it's title so I'm trying to place a textbox in the report header whose control source can find the active control on the screen that called it.

    Ive tried a number of options without success. I've checked dozens of forums also without and answer.



    Thanks,
    Sean

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    In VBA, can pass a value to the report with the OpenArgs argument then the report can read that value in VBA function or textbox ControlSource (=[OpenArgs]). OpenArgs is the last argument of DoCmd.OpenReport (or OpenForm). VBA Help has more info. I guess macro has equivalent.
    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.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The OpenReport command has an OpenArgs argument that can be used to pass values to the Report.

  4. #4
    Seamus59 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    34
    Quote Originally Posted by RuralGuy View Post
    The OpenReport command has an OpenArgs argument that can be used to pass values to the Report.
    Ahh, I totally forgot about OpenArgs! Thanks!

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome. Glad we could help.

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

Similar Threads

  1. report title
    By slimjen in forum Reports
    Replies: 4
    Last Post: 10-07-2013, 01:37 PM
  2. Replies: 1
    Last Post: 03-19-2013, 12:26 PM
  3. Replies: 2
    Last Post: 09-14-2012, 03:49 PM
  4. Dynamic Chart Title in Report
    By Kirsti in forum Reports
    Replies: 10
    Last Post: 03-21-2012, 01:56 PM
  5. HOW DO I: Add or Launch Report from a Form?
    By ba1959nh in forum Forms
    Replies: 2
    Last Post: 09-25-2006, 04:33 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