getting a run time error of no value given for one or more required parameters.
Set sht = Worksheets("Detail"
For i = 1 To RowsCount
For j = 1 To ColsCount
sql_str = "SELECT Sum(Amount) as m " & _
"FROM Entry INNER JOIN Items ON Entry.ItemNum = Items.ItemNum " & _
gWhereStrArr(i) & "And Items.LCD='" & gColNameArr(j) & "'"
Set rs = New Recordset
Debug.Print sql_str
rs.Open sql_str, cn, adOpenStatic, adLockReadOnly
sht.Cells(i + 8, j + 1) = rs.fields("m"
rs.Close
Set rs = Nothing
Next j
Next i
Set sht = Worksheets("Detail"
For i = 1 To RowsCount
For j = 1 To ColsCount
sql_str = "SELECT Sum(Amount) as m " & _
"FROM Entry INNER JOIN Items ON Entry.ItemNum = Items.ItemNum " & _
gWhereStrArr(i) & "And Items.LCD='" & gColNameArr(j) & "'"
Set rs = New Recordset
Debug.Print sql_str
rs.Open sql_str, cn, adOpenStatic, adLockReadOnly
sht.Cells(i + 8, j + 1) = rs.fields("m"
rs.Close
Set rs = Nothing
Next j
Next i