ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Input box that grap data based on user answer (https://www.excelbanter.com/excel-programming/352125-creating-input-box-grap-data-based-user-answer.html)

salooha[_4_]

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


tony h[_46_]

Creating Input box that grap data based on user answer
 

Environ("username") should give you the user's name without having to
enter it. It is normally specified as USR="myname"

regards


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



All times are GMT +1. The time now is 01:53 PM.

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