FIX: ActiveForm Returns Wrong Form (174212)
The information in this article applies to:
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q174212 SYMPTOMS
When the ActiveForm property of the Screen object is queried, the wrong
form is returned as the active form. This behavior occurs after setting the
enabled property of a Command button on another form to False. The second
form is listed as the active form, when the form with the calling code is
actually the active form.
RESOLUTION
To work around this problem, insert the following line of code immediately
after the code that sets the enabled property of the button:
Me.SetFocus
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Modification Type: | Major | Last Reviewed: | 12/10/2003 |
---|
Keywords: | kbbug kbfix KB174212 |
---|
|