Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Data from another worksheet based on user input Alvyn Excel Worksheet Functions 14 August 6th 08 05:41 PM
Incrementing Data based on user input learningaccess Excel Discussion (Misc queries) 3 January 26th 07 03:28 PM
Copy cell data from workbook based on user input Michael A Excel Programming 7 December 31st 05 03:07 PM
Rollup of Data in Multiple Sheets (based on user input) Gauthier Excel Programming 1 December 10th 03 12:55 PM
select data based on user input Dave Ramage[_2_] Excel Programming 0 July 28th 03 12:50 PM


All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"