Solved

access refresh combo box

Posted on 2012-03-29
10
455 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37784683
use the afterupdate event to requery the combo box..
0
 
LVL 70

Expert Comment

by:KCTS
ID: 37784786
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
ID: 37785796
Yes but the after event of which control ?
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37786632
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
ID: 37787024
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37787047
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
ID: 37790591
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37791138
upload a copy of the db
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37838454
mind posting the solution..
0
 

Author Closing Comment

by:topUKlawyer
ID: 37854949
stumblred on solution by chance
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Outlook 2010 not responding when sending email. 4 43
Outlook 2012 VBA: Object missing 14 33
update all email addresses SQL 1 24
microsoft word short cuts 3 37
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

810 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