I would like to use the code below in an EXCEL sub but want to let the user select what they want to pull from the DB. Is there a way to do it? In other words, the user would input their SELECT, FROM, WHERE and ORDER BY.
[VBA] 'creates the SQL statement
szSQL = "SELECT GroupName, GroupContactName " & _
"FROM Groups " & _
"WHERE Group = 'UK' " & _
"ORDER BY GroupName" [/VBA]