I have a form in Access 2010 with a number of queries existing in the same Database. I've created a combo box which provides a list of all of the query names using SQL in the Row Source box in the property sheet:
SELECT m.[name] FROM msysobjects AS m WHERE m.type=5 and m.name not alike "~%" ORDER BY m.name;
The Row/Source type is set to 'Table/Query' and the Bound column is set to '1'. I have also created a command button which I want to link to the combo box (currently called 'Run').
What I'm looking to do is for the command button to run whichever query name the user selects from the Combo Box list, however I'm unsure how this would be achieved. I believe it may require some VBA which I'm not experienced in unfortunately.
I have tried to link the command button directly to the Combo Box however have been unsuccessful, as above I believe this may require some sort of VBA code.
Any help on the above would be really appreciated.