Microsoft KB Archive/252744

= ACC2000: Activating a Commandbar Drop-Down List Causes an Abnormal Program Termination =

Article ID: 252744

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q252744



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you activate a commandbar drop-down list, you may receive one of the following error messages:

If you are running Microsoft Windows 95 or Microsoft Windows 98:

You see the following Microsoft Visual C++ Runtime Library error message:

Runtime error

Program C:\Progra~1\Micros~1\Office\Msaccess.exe

abnormal program termination

If you are running Microsoft Windows NT:

Access appears to stop responding for a few seconds, and then you see the following error message:

MSACCESS.exe has generated errors and will be closed by Windows. You will need to restart the program.

An Error log is being created.



RESOLUTION
To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).

To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base:

245025 OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)



STATUS
Microsoft has confirmed that this is a problem in Access. This problem was corrected in Microsoft Office 2000 SR-1/SR-1a.



Steps to Reproduce Behavior
 Create a new database. Create a new form and save it as frmCommand. Open the frmCommand form in Design view. Create a command button in the form footer, and then set its properties as follows:

Name: cmdDropdown

Caption: Open Command Bar Dropdown

OnClick: [Event Procedure]

  Set the OnClick property of the command button to the following event procedure: Private Sub cmdDropdown_Click Dim cmdBar As CommandBar Dim cmdControl As CommandBarControl

Set cmdBar = CommandBars("Test")

For Each cmdControl In cmdBar.Controls If cmdControl.Type = 4 Then cmdControl.SetFocus SendKeys "{Down}", True End If  Next cmdControl End Sub </li> In the Visual Basic Editor, click References on the Tools menu, and make sure the following reference is selected:

Microsoft Office 9.0 Object Library

NOTE: You may have to scroll through the references to find it.

This references the CommandBars object and its properties.</li>  Set the OnOpen property of the form to the following event procedure: Private Sub Form_Load(Cancel As Integer) Set focusBar = CommandBars.Add(Name:="Test") With CommandBars("Test") .Visible = True .Position = msoBarTop End With

Set testComboBox = CommandBars("Test").Controls. _     Add(Type:=msoControlComboBox, Id:=1)

With testComboBox .AddItem "First Item", 1 .AddItem "Second Item", 2 End With End Sub </li>  Set the OnUnload property of the form to the following event procedure: Private Sub Form_Unload(Cancel As Integer) For Each cmdBar In CommandBars If cmdBar.Name = "Test" Then cmdBar.Delete End If  Next cmdBar End Sub </li> Run the form and click the button. Note that you encounter the symptoms described in the Symptoms section of this article.

NOTE: In Windows NT, it may take a few seconds to see the error message.</li></ol>

Additional query words: pra msaccess exe

Keywords: kbbug kberrmsg kbpending kbprogramming KB252744

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.