Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    11

    Unanswered: Commandbar issue - Invalid Procedure Call or Argument

    This has been working fine for quite some time and now all of a sudden one of my users is getting that message. It is access '97. Here is the line of code that causes the issue:

    --------------------------------------------------------------------------
    Dim MBar As CommandBar, MBarCtl As CommandBarControl
    Dim MBarPopup As CommandBarPopup, MBarSubCtl As CommandBarControl, MBarSubSubCtl As CommandBarControl
    On Error GoTo AddNewMB_Err

    ' Create a new menu bar and dock it on the left.
    Set MBar = CommandBars.Add(Name:="Main Menu Bar", Position:= _
    msoBarTop, MenuBar:=True, Temporary:=False)
    --------------------------------------------------------------------------

    Any thoughts on what may be causing this?

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    If the code didn't change then you might try Repairing the database. Or check the references to make sure they are all there and none are Missing.

  3. #3
    Join Date
    Apr 2004
    Posts
    11
    I found what the issue was. Just after that piece of code was executed, the program crashed on the user. This caused the menu to stay in the database and everytime that the program was run I was getting that error because it was trying to create a menu that already existed. I manually deleted the menu from the database and that solved the issue.

Posting Permissions

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