Refresh drop down list query

P

Pflugs

I would like to program a combo box to simulate the AutoComplete feature in
Excel. I have read the forums on this common issue, and I've set up a few
boxes to do this (while setting "Limit to List" property to false so I can
enter new data). However, the query seems to be static; that is, it only
updates the drop down list as I switch views. How can I set the query to
update after each entered value?

Thanks,
Pflugs
 
A

Arvin Meyer [MVP]

In the after update event of the combo box, create an event procedure with 1
line of code:

Sub ComboName_AfterUpdate()

Me.ComboName.Requery

End Sub
 
P

Pflugs

I added the event procedure, but that still doesn't seem to refresh the drop
down list unless I save and switch back to the design view and back again. I
rechecked the control's properties, and they seem to be correct...
 
A

Arvin Meyer [MVP]

I think I misunderstood what you are trying to do.

You want to alter a list in a table that you are not bound to. To do that
re-enable the NotInList property and Use the NotInList event to add the
record to the other table. I have some code at my website that will allow
you to build a generic event (standard module) and call it from your not in
list event:

http://www.datastrat.com/Code/NotInListCode.txt

The example can use data from the Northwind sample database.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Top