Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom Toolbars in Reports

    Access 97 Database: I have a report that I made a custom tool bar for. When I create a custom tool bar in a form, I can execute functions by typing "=FunctionName()" in the On Action box. In the reports, I do the same thing but returns an error that it can't find the function. I am creating them public in the report's module.

    How do you get the same functionality to work in reports as they do in forms. The function is simply closing the form "DoCmd.Close".

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Custom Toolbars in Reports

    May I suggest a better way? Put all the functions you use for toolbars and menubars into a standard module and call them from there. I keep all such routines in a module I call basCommandbars and just paste it into each new project. That way, I can reuse the same function for more than one form or report. For example, here's my code for closing a report from a custom toolbar:

    Public Function cbCloseReport()
    On Error Resume Next
    DoCmd.Close acReport, Screen.ActiveReport.name
    End Function
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbars in Reports

    I re-did all my functions to the way you suggested. It works great.

    Thanks again, Charlotte.

    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Custom Toolbars in Reports

    You're welcome. You'll also find that it's handy to put that code into each of your applications so you have it when you want to build a custom toolbar.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •