Foxtable(狐表)用户栏目专家坐堂 → 清空值后,报错


  共有1628人关注过本帖平板打印复制链接

主题:清空值后,报错

帅哥哟,离线,有人找我吗?
文道古月
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:303 积分:2363 威望:0 精华:0 注册:2015/10/14 16:55:00
清空值后,报错  发帖心情 Post By:2015/12/28 17:22:00 [只看该作者]

老师好,为甚么清空db2的值之后,一直报错呢?怎么设条件都不行啊

 

Dim cmb As WinForm.ComboBox = e.Form.Controls("移动类型ComboBox2")
Dim cmb1 As WinForm.ComboBox = e.Form.Controls("接收单元ComboBox1")
Dim db1 As WinForm.DropDownBox = e.Sender '定义引用正在发生变化的控件
Dim db2 As WinForm.DropDownBox = e.Form.Controls("移动单元DropBox1")
Dim st As String = db1.Text.SubString(0,4) '取得过账区域项目的值的前四位
Dim str As String = "" ' 在移动的类型表中,查找移动单元包含前四位的行
Dim fiter As DataRow = DataTables("库存查询").Find("[移动单元] = '"& st &"'")
If db1.Value <> "" Or db2.value <> "" Then
    cmb.Enabled = True
    cmb1.Enabled = True       
    If fiter Is Nothing Then
        db2.Value = Nothing
        Tables("转移过账_筛选Table1").Filter = ""
        MessageBox.show("选定区域不存在,请重新输入!")
    Else Tables("转移过账_筛选Table1").Filter = ("[移动单元] = '"& st &"'")
    End If
    For Each dr As DataRow In DataTables("移动类型").Select("'|' + [移动单元] + '|' like '%|" & st & "|%'")
        str += dr("移动代码") & "-" & dr("移动文本") & "|" ''空白+代码,用-连接移动文本,后面的以此用|连接成一个字符串
    Next
    cmb.combolist = str.Trim("|") ''删除多余连接的|
    cmb.value = Nothing
    cmb1.value = Nothing
Else
    cmb.value = Nothing
    cmb1.value = Nothing
    cmb.Enabled = False
    cmb1.Enabled = False
End If


 回到顶部