以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 窗体表下拉功能根据输入内容变化  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=148373)

--  作者:2900819580
--  发布时间:2020/4/6 20:25:00
--  [求助] 窗体表下拉功能根据输入内容变化

想实现在窗体表中修改名称列的内容时,下拉会跟着改变,代码应该写在那里?

Dim cmd As new SQLCommand
cmd.C
Dim tb As Table = Tables(e.Form.Name & "_Table1")

            If e.Form.Controls("TextKhid").value > 0 Then    e.Form.Controls("Txt下拉").text = "jid = " & e.Form.Controls("TextKhid").value
            If dr.IsNull(E.DataCol.Name) = False Then
                If e.Form.Controls("Txt下拉").text > "" Then e.Form.Controls("Txt下拉").text &= " and "
                e.Form.Controls("Txt下拉").text &= " 名称 like \'%" & dr(E.DataCol.Name) & "%\'"
            End If

If tb.Cols.Contains("名称") Then   
    If e.Form.Controls("txt下拉").text > "" Then
        cmd.CommandText = "SEL ECT DISTINCT 名称 From {总表} WHERE " & e.Form.Controls("txt下拉").text
    Else
        cmd.CommandText = "SEL ECT DISTINCT 名称 From {总表} "
    End If
  \'  MessageBox.Show(cmd.CommandText)
    Dim sdt As DataTable = cmd.ExecuteReader()
    tb.cols("名称").ComboList = sdt.GetComboListString("名称")
End If


--  作者:有点蓝
--  发布时间:2020/4/6 20:49:00
--  
没看懂,请上传实例说明