View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
salooha[_4_] salooha[_4_] is offline
external usenet poster
 
Posts: 1
Default Creating Input box that grap data based on user answer


Hi there,

I have a macro that get data from an ODBC connection and dump into a
spreadsheet, the sql code get the data based on the login ID that I
have to manually enter into the vba code.

is there a way to create an inputbox in excel that pass this login ID
as a parameter to the sql code and then get the data based on what the
user enter into the input box?


Code:
--------------------


With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=datasource
dbo.users.ID where users.login = 'userID'
End With

--------------------



thanks in advance for your help..


--
salooha


------------------------------------------------------------------------
salooha's Profile: http://www.excelforum.com/member.php...o&userid=14612
View this thread: http://www.excelforum.com/showthread...hreadid=507476