B
Belu33fr
Hi,
I have a adp (access 2003 sp3) with sql server 2000. On a simple form with a
simple recordsource query, a combobox (cbt) with a standard sql query in
rowsource. All event proc are running well (it is a linked control). The
query result is a large set of records. I imagined a solution where with the
"change" event, I computed a "where" clause for my query as "where personName
LIKE 'xxx%'" with xxx is the start of word striked by the user.
Private Sub cbt_Change()
cbt.RowSource = "SELECT TOP 8 N_person AS GUID, Name + ' ' + Surname AS
Label FROM Person WHERE Name + ' ' + Surname LIKE '" & Mid(cbt.Text, 1,
cbt.SelStart) & "%' ORDER BY Name + ' ' + Surname"
End Sub
This works correctly (combo is correctly populated, suggest is ok, edit is
ok) except when you use "enter" or "tab" keys before the end of the word
(cbt.sellength>0). The combobox stores a value that's not expected.
I said to myself, maybe I made something wrong and I tried it with a
classical mdb. It's work fine.
Somebody has an idea.
Thanks
I have a adp (access 2003 sp3) with sql server 2000. On a simple form with a
simple recordsource query, a combobox (cbt) with a standard sql query in
rowsource. All event proc are running well (it is a linked control). The
query result is a large set of records. I imagined a solution where with the
"change" event, I computed a "where" clause for my query as "where personName
LIKE 'xxx%'" with xxx is the start of word striked by the user.
Private Sub cbt_Change()
cbt.RowSource = "SELECT TOP 8 N_person AS GUID, Name + ' ' + Surname AS
Label FROM Person WHERE Name + ' ' + Surname LIKE '" & Mid(cbt.Text, 1,
cbt.SelStart) & "%' ORDER BY Name + ' ' + Surname"
End Sub
This works correctly (combo is correctly populated, suggest is ok, edit is
ok) except when you use "enter" or "tab" keys before the end of the word
(cbt.sellength>0). The combobox stores a value that's not expected.
I said to myself, maybe I made something wrong and I tried it with a
classical mdb. It's work fine.
Somebody has an idea.
Thanks