Setting recordsource for combobox

H

Herman

Strange problem in my database :

I want a combobox on my form to reflect a list of values depending on a
choice that was made in a frame with 2 option buttons.
So I placed following code on the after update event for the frame :

Select Case Me!fraRecipeOrigine
Case 1
Me!cboRecipe.RowSource = "SELECT DISTINCT RecipeID FROM
tblRecipesA;"
Case 2
Me!cboRecipe.RowSource = "SELECT DISTINCT RecipeID FROM
tblRecipesB;"
End Select
Me!cboRecipe.Requery

This works fine : when the user select option button A in the frame, the
combobox shows him a list of values from table A, the same for B
The problem now : list B is rather long and when the user scrolls down
this list too fast, the list seems to end before the actual end of the
tableA. When a value from the end of the table A is actualy typed in,
the combobox accepts this value. When you drop down the combobox, it
does show the complete list of values.

In short : scrolling down in the dropped down combobox does not display
all the values from the recordsource.

Anybody recognizes this problem? ...and have a solution for it?
 
P

Peter Russell

After your requery command put:

x = me!cborecipe.listcount

having dimmed x somewhere earlier

This forces the whole list to be loaded and visible.


Regards

Peter Russell
 

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

Top