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 (889491)



The information in this article applies to:

  • Microsoft Access 2002

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 "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. Start Access, and then open the Northwind sample project that is named NorthwindCS.adp.
  2. Under Objects, click Forms.
  3. Click the Products form, and then click Design.
  4. On the View menu, click Properties.
  5. Click the Data tab, and then delete the contents of the Record Source property.
  6. Right-click the Products form, click Build Event, click Code Builder, and then click OK.
  7. 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 "products", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
    Set Me.Recordset = rs
    
  8. In the General Declaration section, add the following code:
    Public rs As ADODB.Recordset
  9. On the File menu, click Close and Return to Microsoft Access.
  10. On the File menu, click Save.
  11. On the View menu, click Form View, and then click to select the Discontinued check box.
After you click to select the check box, the program stops responding.

Modification Type:MajorLast Reviewed:12/21/2004
Keywords:kbtshoot kbProgramming kbDatabase kbprb KB889491 kbAudDeveloper