Autoselect values combobox

mischa

Registered User.
Local time
Today, 03:54
Joined
Jul 25, 2013
Messages
63
I would like to let vba select all (one after the other) values in a combobox and run a query. The code has to be run using a Do While Loop for which I already made the condition.

The reason I want to automate this is to allow the user to quickly add new links in the database. The combobox is used in multiple queries.
I rather code it than make new queries for this situation because it involves many queries that would have to be added.

Thanks in advance!
 
I do not understand you question, are you having troubles looping through the content of the ComboBox? Or Creating/Executing the SQL using the values in the ComboBox?
 
I do not understand you question, are you having troubles looping through the content of the ComboBox? Or Creating/Executing the SQL using the values in the ComboBox?

I don't know how the values can be retrieved from the combobox (Your second guess).
 
What is the rowsource of the combobox?
If you need these queries, I think you could generate these by putting the combobox entries in an array, then
generate the query sql as you loop through the array of values.

Do you have some sample data?
 
What is the rowsource of the combobox?
If you need these queries, I think you could generate these by putting the combobox entries in an array, then generate the query sql as you loop through the array of values.

Do you have some sample data?

Thanks for the reactions!

The rowsource of the combobox is: "qryLinkProductComponent_Mapics"
How can I put the combobox entries in an array? (The output is dynamic)

The query shows the user part numbers that are related to a specific part. These are text values and for every part it could show a different set and quantity of part numbers that are linked to this part.

PNMapics
1424780680
1424780732
1424780902
1424780903

I hope this is the information you were looking for.
 

Users who are viewing this thread

Back
Top Bottom