|
Private Sub command18_Click()
strsql = "SELECT 型号,旧型号,规格尺寸,牌子,库存量,产地,类别,货位,报价 FROM 产品 where true"
If Not IsNull(grp1) Then strsql = strsql & " and (牌子=[forms]![按品牌类型查询]![grp1])"
If Not IsNull(grp2) Then strsql = strsql & " and 类别=[forms]![按品牌类型查询]![grp2]"
If Not IsNull(grp4) Then strsql = strsql & " and 货位=[forms]![按品牌类型查询]![grp4]"
If Not IsNull(grp5) Then strsql = strsql & " and 规格尺寸=[forms]![按品牌类型查询]![grp5]"
If Not IsNull(grp6) Then strsql = strsql & " and 产地=[forms]![按品牌类型查询]![grp6]"
Me![按品牌类型查询子窗体].Form.RecordSource = strsql
'DoCmd.OpenReport "按指定条件查询报表", acViewPreview, strsql
End Sub
|
|