VBE hangs .....

message from =?Utf-8?B?V0MgTG8=?= on 28 May 2004
I have the below code. The VBE got hanged when I add the code "Dim qry1 As Recordset". After complete typing the line, the VBE hangs when I move the mouse cursor away to another line. This is quite strange. Any idea? Thanks

Private Sub cboProduct_AfterUpdate()

Dim cnn1 As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset <------ VBE hangs when I move the mouse cursor focus to another line
Dim qry1 Recordset
Dim qry2 As String

Set cnn1 = CurrentProject.Connection
Set rst1 = New ADODB.Recordset
rst1.Open "SELECT * FROM tblProduct " & _
"WHERE ProductCode = '" & Me!cboProduct & "'", _
cnn1, , , adCmdText
Me!cboProductDescription = rst1!ProductDescription
Me!UnitsInStock = rst1!UnitsInStock

'Prepare query for WarehouseCode combo box
qry2 = "SELECT WarehouseCode, WarehouseName FROM tblWarehouse " & _
"UNION Select '(ALL)' as AllChoice, Null as Bogus From tblWarehouse " & _
"ORDER BY WarehouseCode"
With Me.cboWarehouse
.RowSourceType = "Table/Query"
.RowSource = qry2
End With

'Clean up objects
rst1.Close
cnn1.Close
Set rst1 = Nothing
Set cnn1 = Nothing

End Sub
 

Archived message: VBE hangs ..... (Microsoft Access Database)