Dumferling
Member
- Local time
- Today, 08:27
- Joined
- Apr 28, 2020
- Messages
- 102
Is there a reasonably simply way to convert a query to as sql statement and insert that into the rowsource of a listbox programatically? I have several queries for one list box and I swop them out according to the need to look at different information. I want to rather have a sql statement in the rowsource (literally a SELECT etc) rather than the queryname. The reason is I have code which allows me to sort any field by rightclicking on the column but it requires a sql statement in the rowsource of the listbox.
I could create a table and store each sql statement in but it seems a bit roundabout. If there a vba function that can do the conversion?
I could create a table and store each sql statement in but it seems a bit roundabout. If there a vba function that can do the conversion?