1、全局中声明变量_BmNmae
2、以下为下拉窗体的DropDownOpened代码 想问,我想在下拉窗体要打开时增加一个参数,应该在设置下拉的Table那里写代码:BmNmae = “销售部”。
Dim txt As String = e.Form.DropDownBox.Text
Dim tb As Table = Tables(e.Form.Name & "_table1")
Dim dt As DataTable = tb.DataTable
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Sele ct * from {UseGl} where FID = 1 and BmName = '" & _BmNmae & "'"
If txt > "" Then
txt = "'%" & txt & "%'"
cmd.CommandText &= " ( username Like " & txt & " Or bmname Like " & txt & " )"
End If
'MessageBox.Show(cmd.CommandText)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tb.DataSource = cmd.ExecuteReader
tb.SetColVisibleWidth("Itid|88|BmName|88|UseName|88")
tb.AutoSizeCols
e.Form.DropDownBox.Select() '将输入焦点返回下拉列表框
[此贴子已经被作者于2022/5/7 23:58:06编辑过]