Microsoft KB Archive/172275

= FIX: DBCombo's Drop-Down Does Not Work with Mouse in Modal Form =

Article ID: 172275

Article Last Modified on 3/2/2005

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Enterprise Edition

-



This article was previously published under Q172275



SYMPTOMS
The mouse does not select items in the drop-down combo box of DBCombo on a Modal Form in an executable.



RESOLUTION
To resolve this problem, upgrade to Visual Basic 6.0.

In Visual Basic 4.0, the following code will work around the problem: Private Sub Form_Initialize ' Loop thru each form in the FormS collection For Each Form in Forms 'Find each form that is not the current form If Form.Name <> Me. Name Then Form. Enabled = True ' and Disable it    End If   End Sub

Private Sub Form_Unload

' Loop thru each form in the FormS collection For Each Form in Forms

'Re-enable all the forms in the FormS collection If Form.Name <> Me. Name Then Form. Enabled = True End If

End Sub



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Microsoft Visual Basic Professional and Enterprise editions, version 6.0.



Steps to Reproduce Behavior
 Create a New Project in Visual Basic 4.0. Insert a module.  Add the following code: Sub main Form1.Show vbModal End Sub   On Form1, add a Data Control (Data1) and a DBCombo (DBCombo1). Set the following properties: Data1.DatabaseName = biblio.mdb Data1.Recordsource = Authors DBCombo1.RowSource = Data1 DBCombo1.ListField = Author  Under the Tools menu, select Options. Select the Project Tab.</li> Set the Main Procedure for the Startup Form.</li> Build an executable.</li> Run the executable.</li> Drop down the combo box, and try to select an option.</li></ol>

<div class="references_section">