以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 请各位老师帮忙看看这段代码有什么问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=101503) |
-- 作者:zzbyhz -- 发布时间:2017/6/1 19:16:00 -- 请各位老师帮忙看看这段代码有什么问题 下面的这段代码在执行时,不管是否能够查询得到“症状”,都要显示提示对话框“未找到所述症状情况!”。 按道理,应该在查询成功后,不应该出现第二个提示对话框啊。 请各位老师帮忙看看,问题到底出在哪里?
不胜感激。 Dim Filter As String With e.Form.Controls("症状描述") If .Value Is Nothing Then MessageBox.Show("请输入症状情况!", "提示") Else If Filter = "症状 Like \'%" & .Value & "%\'" Then Else MessageBox.Show("未找到所述症状!请重新输入!", "提示") End If End If End With Dim cmb As WinForm.ComboBox = e.Form.Controls("疾病名") Dim str As String = e.Form.Controls("症状描述").Text e.Form.Controls("疾病名").ComboList = DataTables("jbmb").GetComboListString("疾病名","症状 Like \'%" & str & "%\'") |
-- 作者:有点色 -- 发布时间:2017/6/1 20:47:00 -- Dim Filter As String With e.Form.Controls("症状描述") If .Value Is Nothing Then MessageBox.Show("请输入症状情况!", "提示") Return End If End With Dim cmb As WinForm.ComboBox = e.Form.Controls("疾病名") Dim str As String = e.Form.Controls("症状描述").Text e.Form.Controls("疾病名").ComboList = DataTables("jbmb").GetComboListString("疾病名","症状 Like \'%" & str & "%\'") If e.Form.Controls("疾病名").ComboList = Nothing Then MessageBox.Show("未找到所述症状!请重新输入!", "提示") End If |
-- 作者:zzbyhz -- 发布时间:2017/6/1 20:59:00 -- 按照老师的代码,问题果然解决了。看样子还是逻辑关系和次序问题乱了。非常感谢老师的指导! |