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

Combo box not displaying information 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
0
0
ZA
In Access 2000 I have a combo box on a subform
I use a parameter query to filter the records returned by the combo box.
When I navigate to the subform and click on the combo box, the correct records are displayed. However if I go to another record the combo box returns the records relating to the previous record! If I open the combo box's query the correct records are displayed!

What can cause this? Why does the combo box not update itself?
 
When the form loads it populates the combo based on your rowsource query. Unless you write code to requery the combobox it only does it on the forms opening. So as you move to a new record it does refresh the rowsource. There are many ways to tell the combo to refresh. Look at the combo's and the forms refresh and requery methods. And look at the forms oncurrent event.
 
Thanks
The rowsource does not appear to refresh when I move to a new record.
I have tried to requery the combo box in the forms OnCurrent event, but then all values of the combobox, other than the current record, disappear!
 
Actually a better place to requery the combo is in the combo's on enter event.

However, if you have a continous form changing the rowsource does not work well.
Example:
You have a continous form and in the first record you limit your choices to A,B,C and you choose A. You move to the next record and limit the rowsource to C, D, E. Although A is the value of the first combo it will go blank because now ALL the combo's only can display C,D, E. That is just how a continous form works.
You can make a little bit of a workaround by putting a textbox overtop the combobox showing the down arrow. Lock the textbox. When you choose a value from the combo it is displayed in both the textbox and the combobox, but since the textbox lies overtop the combo it appears as if it is in the combo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top