Hello,
I am trying to write some VBA code which builds a SQL query using cells in my excel spreadsheet to build the where clause. I currently have a string like the following: SQLStr= "SELECT * FROM TABLE". I would like to build in some where criteria, which would grab field names and field values from my excel spreadsheet.
The field names are located in cells A6:A13, and the corresponding listboxes containing those fields' values are located in cells B6:B13. When no value is specified for a particular field, the listbox simply displays the word "All". So in other words, if no where clause is needed for a particular field, then its corresponding value simply displays "All" in the excel spreadsheet.
Any thoughts would be greatly appreciated!
I am trying to write some VBA code which builds a SQL query using cells in my excel spreadsheet to build the where clause. I currently have a string like the following: SQLStr= "SELECT * FROM TABLE". I would like to build in some where criteria, which would grab field names and field values from my excel spreadsheet.
The field names are located in cells A6:A13, and the corresponding listboxes containing those fields' values are located in cells B6:B13. When no value is specified for a particular field, the listbox simply displays the word "All". So in other words, if no where clause is needed for a particular field, then its corresponding value simply displays "All" in the excel spreadsheet.
Any thoughts would be greatly appreciated!