Dim txt As String = Forms("窗口1").Controls("TextBox1").valueDim q As new QueryBuilderq.TableName = "销量统计"q.SelectString = "Select 第一列,sum(第二列),第四列 From {表B}Where 第一列 = '" & txt & "' Group By 第一列,第四列"q.BuildMainTable = Tables("销量统计")