以文本方式查看主题

-  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=104110)

--  作者:轩辕绝
--  发布时间:2017/7/23 20:17:00
--  [求助]文本框的求助

老师好。

我的“出库窗口” 上有一个领用人的文本框 名称“姓名”

文本框后有一个查询按钮

有一个“员工信息表”内有,员工编号,姓名……字段

想实现,两种查询后显示员工姓名的方式

1、文本框内输入员工编号,点击查询,

文本框内自动显示员工编号对应的员工姓名

 

2、文本框内输入员工姓名的拼首拼字母,如 王大锤  输入,,WDC,,点击回车后,自动显示  王大锤名字。。

 

 

上述两种方式,如果涉及重名的,可生成列表选择。

谢谢老师。

 


--  作者:有点甜
--  发布时间:2017/7/23 21:32:00
--  

必须用combobox控件。

 

Dim txt As String = e.form.controls("textbox1").text
Dim str As String = DataTables("表A").GetComboListString("姓名", "员工编号 like \'%" & txt & "%\' or 拼音 like \'%" & txt & "%\'")
If str > "" Then
    Dim cbx As WinForm.ComboBox = e.form.controls("combobox1")
    cbx.combolist = str
    cbx.SelectedIndex = 0
End If


--  作者:轩辕绝
--  发布时间:2017/7/23 22:34:00
--  
请问老师,代码用在哪里 ?
以下是引用有点甜在2017/7/23 21:32:00的发言:

必须用combobox控件。

 

Dim txt As String = e.form.controls("textbox1").text
Dim str As String = DataTables("表A").GetComboListString("姓名", "员工编号 like \'%" & txt & "%\' or 拼音 like \'%" & txt & "%\'")
If str > "" Then
    Dim cbx As WinForm.ComboBox = e.form.controls("combobox1")
    cbx.combolist = str
    cbx.SelectedIndex = 0
End If


--  作者:有点甜
--  发布时间:2017/7/23 22:36:00
--  
查询按钮
--  作者:轩辕绝
--  发布时间:2017/7/23 23:19:00
--  
老师
“拼音”字段是需要在“表A”中加入的么?
能否不加入拼音字段,用姓名自动生成?
以下是引用有点甜在2017/7/23 21:32:00的发言:

必须用combobox控件。

 

Dim txt As String = e.form.controls("textbox1").text
Dim str As String = DataTables("表A").GetComboListString("姓名", "员工编号 like \'%" & txt & "%\' or 拼音 like \'%" & txt & "%\'")
If str > "" Then
    Dim cbx As WinForm.ComboBox = e.form.controls("combobox1")
    cbx.combolist = str
    cbx.SelectedIndex = 0
End If


--  作者:有点甜
--  发布时间:2017/7/23 23:27:00
--  

 必须加入拼音字段

 

http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=103586&replyID=710270&skin=1