W
WC Lo
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? Thank
Private Sub cboProduct_AfterUpdate(
Dim cnn1 As New ADODB.Connectio
Dim rst1 As New ADODB.Recordse
Dim rst2 As New ADODB.Recordset <------ VBE hangs when I move the mouse cursor focus to another lin
Dim qry1 Recordse
Dim qry2 As Strin
Set cnn1 = CurrentProject.Connectio
Set rst1 = New ADODB.Recordse
rst1.Open "SELECT * FROM tblProduct " &
"WHERE ProductCode = '" & Me!cboProduct & "'",
cnn1, , , adCmdTex
Me!cboProductDescription = rst1!ProductDescriptio
Me!UnitsInStock = rst1!UnitsInStoc
'Prepare query for WarehouseCode combo bo
qry2 = "SELECT WarehouseCode, WarehouseName FROM tblWarehouse " &
"UNION Select '(ALL)' as AllChoice, Null as Bogus From tblWarehouse " &
"ORDER BY WarehouseCode
With Me.cboWarehous
.RowSourceType = "Table/Query
.RowSource = qry
End Wit
'Clean up object
rst1.Clos
cnn1.Clos
Set rst1 = Nothin
Set cnn1 = Nothin
End Sub
Private Sub cboProduct_AfterUpdate(
Dim cnn1 As New ADODB.Connectio
Dim rst1 As New ADODB.Recordse
Dim rst2 As New ADODB.Recordset <------ VBE hangs when I move the mouse cursor focus to another lin
Dim qry1 Recordse
Dim qry2 As Strin
Set cnn1 = CurrentProject.Connectio
Set rst1 = New ADODB.Recordse
rst1.Open "SELECT * FROM tblProduct " &
"WHERE ProductCode = '" & Me!cboProduct & "'",
cnn1, , , adCmdTex
Me!cboProductDescription = rst1!ProductDescriptio
Me!UnitsInStock = rst1!UnitsInStoc
'Prepare query for WarehouseCode combo bo
qry2 = "SELECT WarehouseCode, WarehouseName FROM tblWarehouse " &
"UNION Select '(ALL)' as AllChoice, Null as Bogus From tblWarehouse " &
"ORDER BY WarehouseCode
With Me.cboWarehous
.RowSourceType = "Table/Query
.RowSource = qry
End Wit
'Clean up object
rst1.Clos
cnn1.Clos
Set rst1 = Nothin
Set cnn1 = Nothin
End Sub