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