Solved

access refresh combo box

Posted on 2012-03-29
10
432 Views
Last Modified: 2012-06-27
I thought i could do this but the knack has escaped me.

OK, field on form also features as one of the fields returned in combo box which combo box selects the records in the form.

However when I change the field (its a lookup field) and I would like the combo box to immediately reflect that change when entered.

Its probably an after update/current form event/refresh something or other but Im not doing what I should be doing.

So help please.
0
Comment
Question by:topUKlawyer
10 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
use the afterupdate event to requery the combo box..
0
 
LVL 70

Expert Comment

by:KCTS
Comment Utility
Agreed - as the last instruction in the code add

me.ComboBoxName.requery

(where ComboBoxName is the name of your combo box)
0
 

Author Comment

by:topUKlawyer
Comment Utility
Yes but the after event of which control ?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
isn't this an obvious thing, you posted
<However when I change the field (its a lookup field) and I would like the combo box to immediately reflect that change when entered.>

what is that "field" ?
0
 
LVL 20

Expert Comment

by:clarkscott
Comment Utility
Sometimes, my combobox source table contains more info than shown in the combo.  In these cases, I create a bound "list" form to the combo source table with the ability to add records.  Then, from the DOUBLE-CLICK event of the combo, I open this form, in dialog mode, let the user add the required record, then - when the form is closed, the code requeries the combo box to include the newest record... me.cboYourBox. requery

Scott C
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
fwiw - you can refer to this link
Use NotInList Event to Add a Record to Combo Box
http://support.microsoft.com/?kbid=197526
0
 

Accepted Solution

by:
topUKlawyer earned 0 total points
Comment Utility
perhaps my question was not posted as accurately as you would wish
I dont know.

I have sorted it out anyway,

in the text box there is a lookup field.

The adjacent combo also picks up that field  when changed but only when the form is closed and reopened.
i wanted to reflect that change as soon as it happened.

putting a combo box requery in the after update event of the text box only worked when the form was closed and opened again-not what i needed.

however it did work when i put me. refresh in the text box after update event just before
the combo requery.
this alerted the requery to the fact that the text box contents had changed
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
upload a copy of the db
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
mind posting the solution..
0
 

Author Closing Comment

by:topUKlawyer
Comment Utility
stumblred on solution by chance
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now