Requerying a Flex Grid

I have a VB6 form that uses the Data Environment and a command object that uses a table to initially populate a flex grid on the form. I want to be able to limit that list based on criteria that I choose from a list box. For Example: If I choose Seattle from the list, the flex grid would automatically requery to only show records associated with Seattle.

Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you use MsFlexGrid, VsFlexGrid witch one?
You will still be required to repopulate that flexGrid.
You have to requery the grid every time the list box item is selected.  I don't know if that's posible with a data environment, since it would have to use a select query with a parameter that you supply from the list box and then refresh or requery.  But, you could code a connection to execute a query and return the results to repopulate the grid.  I use arrays to hold recordsets returned this way.  Then loop through the array to populate the grid.  This would give you more direct control over exactly when to refresh the grid.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jon is right, you can assign the parameter the values of the list box...Do you need some code?  Is the query called from the database(Querydef) or is it an array?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.