Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autocomplete in from fields

Status
Not open for further replies.

somewhereelse

Technical User
Mar 26, 2003
8
US
Is there a way to make the field of a form autocomplete a word such as a name, when you begin typing it. There are a few names that are entered frequently, and some names that are used infrequently (or just once or twice). Is there a way to make it so the user can enter a name without having to type it in completely. Also, the field that contains the names will have more than one name it it. Like: Participants in an Event: 'list of people participating'

Or, is there a way to have a drop down list of names, but still be able to enter a different(new) name into the field if it is not in the list?

Any help would be greatly appreciated!
Thanks.
[flowerface]
 
Set up a combo box. In design view, open the properties window.

If the names you're filling in are contained in a table, set the "row source type" to "Table/Query". If you just want to put in a list of names, set it to "Value List"

In the "row source" property field, you can specify a table or query to use, or use the query builder to pull what you want from a table or query. If you just want a list of names, type them in separated by a semi-colon.

Set "Limit to List" to "No" and "Auto Expand" to "Yes".

That should do exactly what you want - you'll have a drop down list of names; if you start typing, it will fill them in for you, or you can select from the list, or type in something that's not in the list.



 
Ok, I get all that, and it works, but I need to be able to have the names of more than one person in the field at the same time (and the number of people varies). Can I do that?
Thank you.
[spin]
 
If I understand correctly, you want to have something like this in the field:

Name1,Name2,Name3

If so, set up a text box, along with your combo box (call them MyText and MyCombo, for purposes of illustration). Put this code into the "DoubleClick" event of the text box.

Private Sub MyText_DblClick(Cancel As Integer)

Dim MyString
Dim SP
SP = ","
MyString = MyText.Text
MyText.Text = MyString + SP + MyCombo

End Sub

Double clicking in the text box will add the name shown in the combo box to the list.

For what it's worth, I'd avoid putting more than one name in a field - In most cases I'd create duplicate records with a single name in each record. That makes it easier to run queries, etc. on your data (of course, I don't know what you're doing this for, so it may make perfect sense).



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top