Foxtable(狐表)用户栏目专家坐堂 → [求助]ComboBox的下拉列表值


  共有11683人关注过本帖树形打印复制链接

主题:[求助]ComboBox的下拉列表值

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/2/9 9:55:00 [显示全部帖子]


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/2/9 10:26:00 [显示全部帖子]

在ComboxBox2的Enter事件中设置代码:

 

Dim cmb As WinForm.ComboBox = e.Sender

Dim str As String = e.Form.Controls("ComboBox1").Value
cmb.ComboList = DataTables("现有量").GetComboListString("批号", "物料 = '" & str & "'")


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/2/9 10:34:00 [显示全部帖子]

看看代码到底执行了没有:

 

MessageBox.show(e.Sender.Name)

If e.Sender.Name.SubString(0,4) = "ComboBox2" Then '如果名称符合

    MessageBox.show(e.Sender.Name)

    Dim cmbl As WinForm.ComboBox = e.Sender
    Dim str As String = e.Form.Controls("ComboBox1").Value
    cmbl.ComboList = DataTables("现有量").GetComboListString("批号", "物料 = '" & str & "'")
End If


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/2/9 11:21:00 [显示全部帖子]

不会有的别的原因,要么条件有问题,要么根本就没有符合条件的数据,这样检查一下:

 

If e.Sender.Name.SubString(0,4) = "ComboBox2" Then '如果名称符合

    Dim cmbl As WinForm.ComboBox = e.Sender
    Dim str As String = e.Form.Controls("ComboBox1").Value
    cmbl.ComboList = DataTables("现有量").GetComboListString("批号", "物料 = '" & str & "'")

    MessageBox.Show(Str)
    MessageBox.Show("物料 = '" & str & "'")

    MessageBox.Show(DataTables("现有量").GetComboListString("批号", "物料 = '" & str & "'"))

End If


 回到顶部