北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
请教大家怎么追加查询代码,现有查询代码如下
Private Sub cmd查询_Click() On Error GoTo Err_cmd查询_Click Dim strWhere As String strWhere = "" If Not IsNull(Me.库位) Then strWhere = strWhere & "([库位] like '*" & Me.库位 & "*') AND " End If If Not IsNull(Me.包装形式) Then strWhere = strWhere & "([包装形式] like '" & Me.包装形式 & "') AND " End If If Not IsNull(Me.品种) Then strWhere = strWhere & "([品种] like '*" & Me.品种 & "*') AND " End If If Not IsNull(Me.生产批号) Then strWhere = strWhere & "([生产批号] like '" & Me.生产批号 & "') AND " End If If Not IsNull(Me.包装批号) Then strWhere = strWhere & "([包装批号] like '" & Me.包装批号 & "') AND " End If If Not IsNull(Me.开始日期) Then strWhere = strWhere & "([日期] >= #" & Format(Me.开始日期, "yyyy-mm-dd") & "#) AND " End If If Not IsNull(Me.截止日期) Then strWhere = strWhere & "([日期] <= #" & Format(Me.截止日期, "yyyy-mm-dd") & "#) AND " End If If Len(strWhere) > 0 Then strWhere = Left(strWhere, Len(strWhere) - 5) End If Debug.Print strWhere Me.出入库明细_查询_子窗体.Form.Filter = strWhere Me.出入库明细_查询_子窗体.Form.FilterOn = True Call CheckSubformCount Exit_cmd查询_Click: Exit Sub Err_cmd查询_Click: MsgBox Err.Description Resume Exit_cmd查询_Click End Sub