ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Combo box from MSQuery (https://www.excelbanter.com/excel-worksheet-functions/64433-combo-box-msquery.html)

Dean

Combo box from MSQuery
 
I would like to be able to run the following query when ever a user clicks
the down arrow on a Combo box, and have the output returned to the list for
the user to select from. How?

or instead of the query below is there another, easier way to return info
from an MS Query into the drop down list of a list/Combo box, for the user to
select an item from and then have an action carried out on the ouput?

Thanks in advance

Dean

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=Exceed;UID=deletedr;PWD=deleted;SERVER=d eleted;",
Destination:=Range _
("C6"))
..CommandText = Array("Select Loc.Loc" & Chr(13) & "" & Chr(10) & "From
DC5999D.Loc Loc")
..Name = "Query from Exceed"
..FieldNames = True
..FillAdjacentFormulas = False
..PreserveFormatting = True
..RefreshOnFileOpen = False
..BackgroundQuery = True
..RefreshStyle = xlInsertDeleteCells
..SavePassword = True
..SaveData = True
..AdjustColumnWidth = True
..RefreshPeriod = 0
..PreserveColumnInfo = True
..Refresh BackgroundQuery:=False


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com