合同组合框_DropDownClosed
If vars("选择") Then '如果选择了值
Dim tbl As Table = Tables("合同组合框_Table1")
Dim dr As Row = tbl.current
If e.Form.DropDownBox.Name = "合同编号" Then
e.form.DropDownBox.Value = dr("合同编号")
ElseIf e.Form.DropDownBox.Name = "合同名称" Then
e.form.DropDownBox.Value = dr("合同名称")
ElseIf e.Form.DropDownBox.Name = "供应商" Then
e.form.DropDownBox.Value = dr("供应商")
End If
Forms("合同分配").Controls("合同编号").Value = dr("合同编号")
Forms("合同分配").Controls("合同名称").Value = dr("合同名称")
Forms("合同分配").Controls("供应商").Value = dr("供应商")
End If
合同组合框_DropDownOpened
vars("选择") = False
Tables("合同组合框_Table1").Filter = ("合同状态 = '已签未开始送货'or 合同状态 = '补充合同' " )
Dim txt As String = e.Form.DropDownBox.Text
Dim tbl As Table = Tables("合同组合框_Table1")
If txt = "" Then
tbl.Filter = ("合同状态 = '已签未开始送货'or 合同状态 = '补充合同' " )
Else
txt = "'%" & txt & "%'"
tbl.Filter = "合同编号 Like " & txt & " "
End If
'tbl.RepeatFilter("合同编号",1)
tbl.Sort = "合同编号,供应商 "
e.Form.DropDownBox.Select() '将输入焦点返回下拉列表
keydown事件
If e.KeyCode = Keys.Enter Then
vars("选择") = True
Forms("合同组合框").DropDownBox.CloseDropdown()
End If
DoubleClick事件
vars("选择") = True
e.Form.DropDownBox.CloseDropdown()
[此贴子已经被作者于2017/8/15 11:14:01编辑过]