+ Reply to Thread
Results 1 to 2 of 2

Creating Input box that grap data based on user answer

Hybrid View

  1. #1
    Registered User
    Join Date
    09-22-2004
    Posts
    13

    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?

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

    thanks in advance for your help..

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    Environ("username") should give you the user's name without having to enter it. It is normally specified as USR="myname"

    regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1