以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]筛选条件出错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=193960) |
-- 作者:lgj716330 -- 发布时间:2024/10/28 21:07:00 -- [求助]筛选条件出错 Dim FtNY As String Dim ayf As WinForm.RadioButton = e.form.Controls("按月份") Dim arq As WinForm.RadioButton = e.form.Controls("按日期") Dim NY1, NY2 As Integer Dim NY3 As String NY1 = e.form.Controls("QZNY1").value NY2 = e.form.Controls("QZNY2").value NY3 = e.form.Controls("PCNY").value If ayf.Checked = True Then If ny3.Length > 0 Then FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & " and 年月 Not in (" & ny3 & ")" ElseIf ny3 = "" Then FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & "" End If ElseIf arq.Checked = True Then FtNY = "日期 >= \'" & rq1 & "\' and 日期 <= \'" & rq2 & "\'" End If msgbox(FtNY) 上面绿色部分执行没问题,黄色部分提示以下错误,把条件去掉单单执行FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & ""也是没有问题,有点晕 |
-- 作者:lgj716330 -- 发布时间:2024/10/28 21:14:00 -- 哦,解决了,条件倒转一下就没问题了 |