老师好,组合框2根据组合框1来显示下一级字段,怎样从外部数据表中获取。
老师,组合框2不显示字段,不知道那里不对。
Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("ComboBox1").Value
Dim qzf1 As New SQLCommand
Dim qz2 As DataTable
qzf1.C
qzf1.CommandText = "SELECT DIS TINCT 客户供应商 ,企业经办人 Fr om {通讯录}"
qz2 = qzf1.ExecuteReader
Dim cs2 As String = qz2.GetComboListString("客户供应商", "企业经办人 = '" & str & "'")
e.Form.Controls("ComboBox2").ComboList = cs2
以下是引用江南小镇在2024/2/27 7:47:00的发言:
老师,组合框2不显示字段,不知道那里不对。
Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("ComboBox1").Value
Dim qzf1 As New SQLCommand
Dim qz2 As DataTable
qzf1.C
qzf1.CommandText = "SELECT DIS TINCT 客户供应商 ,企业经办人 Fr om {通讯录}"
qz2 = qzf1.ExecuteReader
Dim cs2 As String = qz2.GetComboListString("客户供应商", "企业经办人 = '" & str & "'")
e.Form.Controls("ComboBox2").ComboList = cs2
老师,我摆在Enter事件中
什么乱七八糟的,组合框1显示的是供应商,组合框2却按管理员进行查询
此主题相关图片如下:qq截图20240229105532.jpg
没有符合条件的行啊,e.Form.Controls("ComboBox1").Value 是江苏,管理员列江苏对应的值为:苏州|太仓
你是这个意思吧?
此主题相关图片如下:22222222.jpg
e.Form.Controls("ComboBox2").ComboList = dt.GetComboListString ("管理员", "[客户供应商] ='" & str & "'")
[此贴子已经被作者于2024/2/29 11:03:38编辑过]