Knowledge Base

BUG: Focus Changes Even Though Grid Text Box Valid Returns .F.

Article ID: 191686

Article Last Modified on 5/12/2003


APPLIES TO


This article was previously published under Q191686

SYMPTOMS

In a grid, focus leaves the text box control to go to the control you are clicking even though the Valid method of the text box returns .F. or 0. However, the focus remains unchanged in the text box control when you are tabbing out to move to a different control.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new form, named mytest.
  2. Add a one column grid to the form and two Command buttons.
  3. In the Load event of the form, insert the following code:
          SET SAFETY OFF
          CREATE TABLE xyz (name C(10))
          INSERT INTO xyz VALUES ("test")
    							
  4. In the Valid method of the text box in the grid, place the following code:
          RETURN .F.
    							
  5. Save and run the form.
After you open the form, click Command button 1. The "Invalid input" message appears and then the focus shifts from the text box in the grid to the Command button. At the same time, the grid's text box also has a black border indicating that it also has focus. At this point, if you press the Tab key, the focus moves to the other command button. Apparently, the focus is no longer with the text box even though the Valid method in the text box is returning false.

Additional query words: kbVFp600bug kbVFp500abug kbVFp300bbug kbCtrl kbContainer

Keywords: kbbug kbnofix KB191686