Update Query for Lookup Combo Box

G

gagecres

I added a lookup box on my form and it works fine, except I have to close the
form and reopen it to see the names I just entered on the form in the lookup
drop down box. I'm pretty sure I need to use a Requery macro, but I don't
know where to put it. I've tried putting it in "Before Update", "On Got
Focus", and as part of the "After Update" macro that the wizard created. I'm
at a loss, please help.
 
D

Douglas J. Steele

Are you doing a requery of the form, or of the combo box? It should be the
combo box...
 
G

gagecres

I'm doing a requery of the combo box. When I do that, the names do show up
in the combobox, but then the lookup part doesn't work.
 
G

gagecres

I mean when I put the requery macro in the combo box properties all it does
is requery. The most recent names show up in the drop down list, but it no
longer brings up the form for the specific name I select from that list.
 
D

Douglas J. Steele

You're making this difficult!

What do you mean by "put the requery macro in the combo box properties"?

Are you saying that in the AfterUpdate event property, you've put the name
of a macro? That macro is all that's going to run then. If it doesn't open
the form, it's not to to open on its own...
 
G

gagecres

In Access 2007 I used the combo box wizard to create a lookup box that would
bring up the data for the name I choose from the drop down list in the lookup
box. This works fine. I am wanting to change the lookup box so that as I
enter new names using my form, they automatically appear in the drop down
list in the lookup box. Right now I have to close the form and reopen it for
the new names I just entered to appear in that drop down list. My first
thought on how to do this is to use a requery macro somewhere, but I don't
know where to put it. Should I be using a requery macro to accomplish this?
If so, where should I put it? If not, how do I accomplish this?
 
G

gagecres

Never mind, I figured it out. I just needed to put Me.Combo71.Requery in the
AfterUpdate property for the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top