By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

AutoComplete

P: 53
How a Bounded TextBox could give AutoComplete choices from a field in a table to the user?

I searched about this in the internet but i could not found any things!

Thanks in Advanced
Apr 12 '10 #1

✓ answered by TheSmileyCoder

I would use a combobox, with the rowsource set to:
"SELECT distinct tx_LastName FROM tbl_Users ORDER BY tx_LastName"

This will let you use all the previous entries as a source of autocompletion. (or autoexpand as missingling wrote.

Share this Question
Share on Google+
7 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
Hi
Since I don't know how experienced you are, im gonna start of by asking:
Are you sure a combobox doesn't suit your needs? They come with autocomplete.

Try explaining what you need it for, that will allow us to give you the best possible help.
Apr 12 '10 #2

P: 53
@TheSmileyOne
If a field's value/values be predictable or constant the best way ,as you said,is ComboBoxes But assume that a field such as "LastName" with various values,I do not know all last names in the world to enter in a Comboboxe's source data to use!
in other way ,with TextBoxes, it is not interesting Database user types all last names even that are similar and repetitive!

Thanks So
&
Excuse me for puny English knowledge
Apr 12 '10 #3

missinglinq
Expert 2.5K+
P: 3,532
...I do not know all last names in the world to enter in a Comboboxe's source data to use!
I'm sorry but your post simply makes no sense! There is no way for any autocomplete hack to work, whether a combobox or a textbox, without a source! Where do you think Access is going to come up with the data to attempt to guess whether you mean Adams or Adar when you type in Ad if it doesn't have a sorce for last names?

The best approach for this, as Smiley said, would be a combobox with its inherent autocomplete (actually called Autoexpand) feature. You can then use the NotInList event of the combobox to write a routine to add new names as you come to them.

Linq ;0)>
Apr 12 '10 #4

TheSmileyCoder
Expert Mod 100+
P: 2,321
I would use a combobox, with the rowsource set to:
"SELECT distinct tx_LastName FROM tbl_Users ORDER BY tx_LastName"

This will let you use all the previous entries as a source of autocompletion. (or autoexpand as missingling wrote.
Apr 12 '10 #5

P: 53
@missinglinq
You are right!
Assume now db is empty and a user wants to store "Adams" family then he/she must type "Adams" Completely and it is no problem for my user to type a word completely in the first time but i want in the second time or after that when the user types "A" Access shows him/her "Adams"or the other word entered previously in the table and starts with "A" and when user types "d" shows to the user the first word in the table starts with "Ad" ,maybe "Adams",.....with progress in data entry and become database bigger doing type become easier and easier than the past.
if i am in wrong please tell me.
Best wishes for you
A.M
Apr 12 '10 #6

P: 53
@TheSmileyOne
It worked great!Thanks.but i liked to this by a text box.
No problem.
Bye
Apr 12 '10 #7

NeoPa
Expert Mod 15k+
P: 31,494
The facility is not available in a TextBox I'm afraid.

Linq's post explains how to get as close an approximation as possible using ComboBoxes, but the feature you are describing (like that available in Excel) is not available in Access.
Apr 12 '10 #8

Post your reply

Sign in to post your reply or Sign up for a free account.