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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access - autocomplete help

Status
Not open for further replies.

osp001

Technical User
Nov 19, 2003
79
US
I have a form that has a subtable in it for data entry. The first column draws its list from a table (compounds), and the second column is a manual entry (quantity).
I've been trying to figure out how to autocomplete when I start typing in the first column; I'd like to be able to type in "Abc" and have "Abcde" come up so I can select it and tab onto the next column.
Can anyone give me any pointers how to do this?
Thanks!
 
Access automatically does that I believe...the only time that won't happen is if the first letters you type are in multiple records (ie "ABCD" and "ABCE"). I have a combo box that automatically drops down once you start typing...that's easy to do, just put this in the KeyPress event of the combo box:

Me.ComboBoxName.Dropdown

Hope that helps.

Kevin
 
OK; I gave that a shot, and it didn't work. It gives me an error each time, and can't find a macro in the system that works using "dropdown."

I currently have the list box set as a pull-down menu; but when I start to type in a given compound, it doesn't auto-complete.

Sorry to be so thick-headed; I'm learning Access on my own, and the books just aren't that helpful for some of these applications.
 
Combo box. D'OH! Should have specified that. :-/
 
It should work then...if you go to the properties of the combo box and go to the On Key Press event, then type in the code I gave above (dropdown is a method of a combo box).
 
I've tried that- and I get an error: "Microsoft Access can't find the Macro 'Me'". :-/
 
Are you in the code window? When you click in the On Key Press event box there should be three buttons to the right...click on that...then you should end up with this:

Private Sub ComboBoxName_KeyPress(KeyAscii As Integer)
Me.ComboBoxName.Dropdown
End Sub

-and make sure you substitute in the name of your combo box for ComboBoxName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top