ACC2: Find Record Wizard Command Button Has Options Disabled

Last reviewed: May 14, 1997
Article ID: Q126866
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

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

When you choose a Find Record command button that you created with the Command Button Wizard, the Search In option buttons and the Search Fields As Formatted check box are unavailable in the Find dialog box.

CAUSE

When you choose the command button, the command button receives the focus. The Search In option buttons and the Search Fields As Formatted check box are available only when the Find dialog box is invoked from a text box that is based on a field.

RESOLUTION

Add the following line to the code that is generated by the Command Button Wizard so that the focus is returned to the control that had the focus before you chose the command button:

   Screen.PreviousControl.SetFocus

To add this code, follow these steps:

  1. Open the form containing the command button in Design view.

  2. Use the right mouse button to click the command button that you created with the Command Button Wizard, and then choose Build Event from the menu that appears.

  3. Add the following line as the second line of code in the module:

          Screen.PreviousControl.SetFocus
    

    After you add the line, the code should be similar to the following sample code:

          Sub ButtonX_Click ()
             Screen.PreviousControl.SetFocus
          On Error GoTo Err_ButtonX_Click
    
             DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, 10, , A_MENU_VER20
    
          Exit_ButtonX_Click:
              Exit Sub
    
          Err_ButtonX_Click:
              MsgBox Error$
              Resume Exit_ButtonX_Click
    
          End Sub
    
    

  4. Save the form.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.


Keywords : kbusage WzProb
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbcode


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.