Hi,
I have the following SQL query in VBA ...the VBA code is running without errors...
strSQL = "SELECT PlanDespDate,Planned_Qty,BookingType,ShiftName " & _
"FROM Booking_Compliance_B2;"
rs.Open strSQL, conn, adOpenDynamic, adLockPessimistic
The problem is that when I try to retrieve data from the recordset, I get the error of 'Item cannot be found in the collection'.
Thing is that Booking_Compliance_B2 is a stored query NOT a table...I tried copying that SQL and putting it into a query in SQL view and it returns the records..However when I try via VBA i get this error of 'item cannot be found in the colllection'.
Any news of how can I query a query in VBA?
Thanks
I have the following SQL query in VBA ...the VBA code is running without errors...
strSQL = "SELECT PlanDespDate,Planned_Qty,BookingType,ShiftName " & _
"FROM Booking_Compliance_B2;"
rs.Open strSQL, conn, adOpenDynamic, adLockPessimistic
The problem is that when I try to retrieve data from the recordset, I get the error of 'Item cannot be found in the collection'.
Thing is that Booking_Compliance_B2 is a stored query NOT a table...I tried copying that SQL and putting it into a query in SQL view and it returns the records..However when I try via VBA i get this error of 'item cannot be found in the colllection'.
Any news of how can I query a query in VBA?
Thanks