Can Microsoft Access autocomplete fields?
Asked Answered
B

1

6

I'm using Microsoft Access 2007. When I start typing a new record,is there a way to get access to suggest things I've previously typed, to save me time typing the whole word in? For example when I start typing S, it might start suggesting words that I've already typed beginning with S, then if I type ST it might suggest STATION and I can just press enter to insert that word?

Bivins answered 6/3, 2013 at 21:35 Comment(7)
You included a tag for combobox; seems to me that could be the most inexpensive solution. Make the combo row source a query: SELECT DISTINCT YourField FROM YourTable ORDER BY YourField;Leaper
@Leaper +1 You should put your comment as an answer... it solves this questionBurks
hi thanks for reply i tried your query but it does not solve i think something wrong with my tables.my department Description field i already enter a value there but my new value entered does not add up to my dropdownlist items nor add up to my Department tables..can you point whats wrong in my tablesBivins
i did not get any error message,my new values is stored but my last value entered was lost, no new row added.i dont have any value on control Source,Bound value was set to 1Bivins
Set the Control Source to the name of the field which will receive the combo value. That's called "binding" the combo to a field. With no Control Source, you have an "unbound" combo ... which means it doesn't store anything anywhere.Leaper
thanks HansUp..im new to access 2007 but Yourtable you mean the combine table which i have all table(eg Department,School etc) or my specific table that i have only Department list.cause i have only 3 tables schools, department and students and i have another tableName which combine those, to output my result in my form..for control Source that the Name DepartDesc for example or something else..thanksBivins
Replace "YourTable" with the name of the table which contains the field which is the control source for your combo box.Leaper
L
9

Your question includes a tag for combobox; seems to me that could be the most inexpensive solution.

Make the combo row source a query:

SELECT DISTINCT YourField
FROM YourTable
ORDER BY YourField;

With the combo's "limit to list" property set to "No", the user can add a value which doesn't exist in the previously stored values.

Alternatively, set that property to "Yes" and write VBA code for the combo's "On Not in list" event.

Either way, you should have an index on YourField. You can .Requery the combo's row source from the form's On Current event so that it "refreshes" to pick up the newest additions.

Leaper answered 6/3, 2013 at 21:46 Comment(6)
hi hans why my new text entered is not in my combo box dropdownlist but it saved in my database..only the text value was in my dropdownlist a values i entered first when i create my tableBivins
Do you Requery the combo after you add new values to the table?Leaper
i did that but it doesn't work in access 2007.faculty form i have staffdesc combo box..this is my code on Form type on Events tab...Private Sub Form_Current() Me.StaffDesc.Requery End SubBivins
That sounds correct to me. I don't understand why it's not working. Perhaps you can upload a copy of your db to a file sharing site and give a link.Leaper
Hi hansUp..i deal with three table..like ITStaff,AccountsStaff and SoftwareStaff with their ID and Description entered..so i in my FacultyForm i have ITStaffID,ItstaffDesc,AccountsStaffDesc and SoftwareStaffDEsc all have combo box except ITStaffID..im not sure in Form event Oncurrent which one is do the Requery?Bivins
If you're uncertain, Requery all 4 combos.Leaper

© 2022 - 2024 — McMap. All rights reserved.