北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |
有一查询窗体。设有N个组合框。现在根据文本框的内容查询。
子窗体的数据源来源一个查询。当组合框框没数据。CLICK 事件没问题。当有数据。CLICK 出现以下提示
"characters found after end of SQL statement
为啥会报错?
Private Sub Command15_Click()
Dim strSQL As String
strSQL = "select * from q总账明细 where 1=1;"
If IsNull(Me.Combo11) = False Then
strSQL = strSQL & " and EGAIT1 like '*" & Me.Combo11 & "*'"
End If
If IsNull(Me.Combo9) = False Then
strSQL = strSQL & "and Nature_ID like '*" & Me.Combo9 & "*'"
End If
If IsNull(Me.Combo5) = False Then
strSQL = strSQL & "and Month >= '" & Me.Combo5.Value & "' "
End If
If IsNull(Me.Combo7) = False Then
strSQL = strSQL & "and Month <='" & Me.Combo7.Value & "'"
End If
If IsNull(Me.Text13) = False Then
strSQL = strSQL & "and 归档号 like '*" & Me.Text13 & "*'"
End If
Me.Child25.Form.RecordSource = strSQL
Me.Child25.Form.Refresh
End Sub