CommandBarButton OnAction Property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vincent

    #1

    CommandBarButton OnAction Property

    I was wondering if the CommandBarButto n OnAction property would allow
    you to specify a function from a module to be called. According to the
    post made by Turtle in 1998, the OnAction property can only specify a
    macro name. Is this still the case? I agree with Turtle that "this is
    pretty funky."

    -Vincent

    From: Turtle - view profile
    Date: Sat, Nov 21 1998 4:00 am
    Email: "Turtle" <macderm...@min dspring.com>
    Groups: comp.databases. ms-access,
    microsoft.publi c.access.module sdaovba

    OnAction has to be a macro name. However, this macro can contain only
    the
    one command RunCode and refer to a function (not a sub, but it ignores
    any
    value the function returns.)

    Personally, I think this is pretty funky. It's one of the few places I
    know of where professional programmers use macros.

    - Turtle

  • Vincent

    #2
    Re: CommandBarButto n OnAction Property

    Also, are there any alternatives to the CommandBars for easily creating
    popup menus in VBA? Thanks.

    -Vincent

    Comment

    • Rick Brandt

      #3
      Re: CommandBarButto n OnAction Property

      Vincent wrote:[color=blue]
      > I was wondering if the CommandBarButto n OnAction property would allow
      > you to specify a function from a module to be called. According to
      > the post made by Turtle in 1998, the OnAction property can only
      > specify a macro name. Is this still the case? I agree with Turtle
      > that "this is pretty funky."[/color]

      No it can be the name of a public function. It just can't be a sub-routine.

      --
      Rick Brandt, Microsoft Access MVP
      Email (as appropriate) to...
      RBrandt at Hunter dot com


      Comment

      • Rick Brandt

        #4
        Re: CommandBarButto n OnAction Property

        Vincent wrote:[color=blue]
        > Also, are there any alternatives to the CommandBars for easily
        > creating popup menus in VBA? Thanks.
        >
        > -Vincent[/color]

        In the Customize dialog for command bars you can change any of them that you
        have created to type Popup.

        --
        Rick Brandt, Microsoft Access MVP
        Email (as appropriate) to...
        RBrandt at Hunter dot com


        Comment

        • Lyle Fairfield

          #5
          Re: CommandBarButto n OnAction Property

          "Vincent" <animedreamer@v erizon.net> wrote in news:1144877963 .868769.220530
          @z34g2000cwc.go oglegroups.com:
          [color=blue]
          > I was wondering if the CommandBarButto n OnAction property would allow
          > you to specify a function from a module to be called. According to the
          > post made by Turtle in 1998, the OnAction property can only specify a
          > macro name. Is this still the case? I agree with Turtle that "this is
          > pretty funky."
          >
          > -Vincent
          >
          > From: Turtle - view profile
          > Date: Sat, Nov 21 1998 4:00 am
          > Email: "Turtle" <macderm...@min dspring.com>
          > Groups: comp.databases. ms-access,
          > microsoft.publi c.access.module sdaovba
          >
          > OnAction has to be a macro name. However, this macro can contain only
          > the
          > one command RunCode and refer to a function (not a sub, but it ignores
          > any
          > value the function returns.)
          >
          > Personally, I think this is pretty funky. It's one of the few places I
          > know of where professional programmers use macros.
          >
          > - Turtle[/color]

          One can specify the name of a public function and one can specify
          parameters for the function as literals as
          cbc.OnAction = "=GetComments(1 )"
          (as per Terry Kreft 2006-01-24)

          --
          Lyle Fairfield

          Comment

          Working...