Microsoft KB Archive/889491

= A project stops responding when you select a check box on a form that is based on an ActiveX Data Objects recordset in Access 2002 =

Article ID: 889491

Article Last Modified on 12/21/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article applies only to a Microsoft Access project (.adp).

Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you select a check box in a form that was created in a Microsoft Access 2002 project, the program may stop responding when the following conditions are true:
 * The form is based on an ActiveX Data Objects (ADO) recordset.
 * In the Form_Open event, you set the Record Source property to the ADO recordset.



WORKAROUND
To work around this problem, use a combo box control to represent the true and false conditions of a check box control. The following steps are an example of how to do this:
 * 1) Start Microsoft Access, and then open the sample Access project that is named NorthwindCS.adp.
 * 2) Under Objects, click Forms.
 * 3) Click the Products form, and then click Design.
 * 4) In the toolbox, click the Combo Box tool, and then click a position on the form where you want to position the new control.
 * 5) In the Combo Box Wizard, click I will type in the values that I want, and then click Next.
 * 6) In the Col1 column, add two entries.
 * 7) Type True in the first record that you added in step 6, type False in the second record that you added in step 6, and then click Next.
 * 8) Click Store that value in this field, click Discontinued in the drop-down list, and then click Next.
 * 9) In the What label would you like for your combo box box, type Discontinued, and then click Finish.
 * 10) On the View menu, click Properties.
 * 11) In the Combo Box Properties dialog box, type Discontinued in the Control Source box, and then press ENTER.

Note After you have added the combo box control, you can delete the Discontinued check box control from the form.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior
 Start Access, and then open the Northwind sample project that is named NorthwindCS.adp. Under Objects, click Forms. Click the Products form, and then click Design. On the View menu, click Properties. Click the Data tab, and then delete the contents of the Record Source property. Right-click the Products form, click Build Event, click Code Builder, and then click OK.</li>  In the Procedure list in the Microsoft Visual Basic Editor, click the Open event of the Form object, and then type the following code: Set rs = New ADODB.Recordset rs.Open &quot;products&quot;, CurrentProject.Connection, adOpenDynamic, adLockOptimistic Set Me.Recordset = rs </li>  In the General Declaration section, add the following code: Public rs As ADODB.Recordset </li> On the File menu, click Close and Return to Microsoft Access.</li> On the File menu, click Save.</li> On the View menu, click Form View, and then click to select the Discontinued check box.</li></ol>

After you click to select the check box, the program stops responding.

Additional query words: ACC2002 hang

Keywords: kbtshoot kbdatabase kbprogramming kbprb KB889491

-

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

© Microsoft Corporation. All rights reserved.