How about just 1?
Dim Products as Variant
sSQL = "SELECT DISTINCT product FROM Production_Forecast;"
rst.Open sSQL, cnt
Products = rst.GetRows()
rst.Close
MsgBox UBound(Products)
Msgbox Products(0)
It's not reading anything into the array, msgbox Ubound(Products) always displays '0' and msgbox Products(0) results in a subscript out of range.
I know for sure the SQL statement is returning data as if I use:
rst.Open sSQL, cnt
If Not rst.EOF Then
Range("Data!C1").CopyFromRecordset rst
End If
it works just fine.
Bookmarks