想高手请教
Private Sub DataRefresh()Dim StrSearch As String
Dim StrGroup As String
Dim TmpSource As String
Dim TmpS1 As String
Dim TmpS2 As String
StrSearch = ""
StrGroup = " Group By "
StrSearch = ""
If Check1.Value <> 1 Then
If Len(Trim(dco_UType.Text)) > 0 Then '设置一级分类
StrSearch = " And t.UpperId=" + Trim(dco_UType.BoundText)
End If
If Len(Trim(dco_Type.Text)) > 0 Then '设置二级分类
StrSearch = " And s.TypeId=" + Trim(dco_Type.BoundText)
End If
If Len(Trim(dco_Store.Text)) > 0 Then '设置原辅料名称
StrSearch = " And OId=" + Trim(dco_Store.BoundText)
End If
End If
Dim StrSearch3 As String
If Len(Trim(txtSDate)) = 0 Then
If Len(Trim(txtEDate)) > 0 Then
StrSearch3 = " And InDate<=#" + Trim(txtEDate) + "#"
End If
Else
StrSearch3 = " And InDate>=#" + Trim(txtSDate) + "#"
If Len(Trim(txtEDate)) > 0 Then
StrSearch3 = StrSearch3 + " And InDate<=#" + Trim(txtEDate) + "#"
End If
End If
TmpS1 = "Select s.t1Name AS 来料单位名称,s.t2Name AS 生产款号名称,s.OName AS 生产面辅料名称," _
+ "IIF(SUM(v.InAmount) IS NULL,0,SUM(v.InAmount)) AS 入库总数量" _
+ " From v_Store s Left Join" ' + "IIF(SUM(v.inSum) IS NULL,0,sum(v.inSum)) AS 制单总数"
TmpSource = TmpS1 + " (Select * From v_StoreIn Where 1=1 " + StrSearch3 _
+ "" + StrSearch + ") v On s.OId=v.OId Group By s.t1Name,s.t2Name,s.OName"
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = TmpSource
' MsgBox TmpSource
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(0).Width = 0
DataGrid1.Columns(1).Width = 2200
DataGrid1.Columns(2).Width = 2000
DataGrid1.Columns(3).Width = 1500
在上面的源码中,为什么添加s.OStyle AS 型号 会出现至少一个参数未被指定值?OStyle这个字段在表Store中
我是菜鸟,还请高手指点