Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    42

    Unanswered: Toolbar function

    I wanted to build a toolbar function in the form, but after clicking on the button, in the form of an arrow, the error says that no such function exists. Where could the error be ?

    Private Function ToolbarWar()

    Dim cbr As Object
    Dim cbb As Object
    ' msoBarTop = 1
    Set cbr = CommandBars.Add(Name:="ToolbarWar", Position:=1, Temporary:=True)

    Set cbb = cbr.Controls.Add(Type:=1, Temporary:=True)
    With cbb
    .Caption = "My Button"
    .FaceId = 41
    .Width = 60
    .FontSize = 250

    .OnAction = PRR
    End With

    End Function

    Private Function PRR()
    DoCmd.Close
    End Function

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Where is the function, relative to the forms code?
    What is the code in the OnClick event of the button?
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    .OnAction = "PRR"


    Environment:
    Self Taught In ALL Environments.....And It Shows!


  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Apologies, missed that bit!

    Just out of interest what happens if you just use
    Code:
    .OnAction = DoCmd.Close
    George
    Home | Blog

Posting Permissions

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