以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  动态下拉框  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=99702)

--  作者:刘林
--  发布时间:2017/4/25 12:04:00
--  动态下拉框

Dim dwmc As String = user.group
Dim ksmc As String = trim(e.Sender.Text)
Dim dt As DataTable = DataTables("成绩")
Dim cmb3 As WinForm.ComboBox = e.form.Controls("ComboBox3")
cmb3.ComboList = dt.GetComboListString("学校班级", "单位名称= \'" & dwmc & "\' and 考试名称 = \'" & ksmc & "\'")

 

在commbobox2textchanged事件中写的想在改变下拉选择的时候在commbobox3下拉框中生成想要的选项

请问老师,上面的commbobox3没有生成选项呢,前提有不同的学校班级


--  作者:有点色
--  发布时间:2017/4/25 12:07:00
--  

1、加入msgbobx

 

msgbox("单位名称= \'" & dwmc & "\' and 考试名称 = \'" & ksmc & "\'")

msgbox(dt.GetComboListString("学校班级", "单位名称= \'" & dwmc & "\' and 考试名称 = \'" & ksmc & "\'"))

 

2、如果1不正常,说明没有符合的数据;如果1正常,看看你的combobox3的enter事件是不是写了代码?


--  作者:刘林
--  发布时间:2017/4/25 13:45:00
--  

combobox3没写其他事件,符合条件的数据是有的,就是生成的下拉框没值

 


--  作者:刘林
--  发布时间:2017/4/25 13:49:00
--  

哦,发现了,应该用sqlGetComboListString