+ Reply to Thread
Results 1 to 9 of 9

Database Linked Spreadsheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2006
    Posts
    4
    Yes, the data is coming from an SQL database table. The user will be typing in a value (Primary Key) in Column A, then columns B-I will populate with data from the database table for that primary key value. They will be doing this in numerous rows, then printing the spreadsheet. It has to be in a spreadsheet because they need to be able to add comments and such in column J. How would I do this?
    Last edited by jwilliamson; 05-16-2006 at 01:31 PM.

  2. #2
    Ardus Petus
    Guest

    Re: Database Linked Spreadsheet

    Now you need some VBA code.
    You can use ADODB

    HTH
    --
    AP

    "jwilliamson" <jwilliamson.27wuzy_1147800601.368@excelforum-nospam.com> a
    écrit dans le message de news:
    jwilliamson.27wuzy_1147800601.368@excelforum-nospam.com...
    >
    > I understand how to make a query for myself, but I need to prepare this
    > spreadsheet in such a way that the user can open it, in column A type
    > all of the primary key values they want to see data for, and have it
    > fill in columns B-I with the data from the database about that primary
    > key value. So that they can print it and show it to other managers. How
    > would I go about doing that? Is it possible?
    >
    >
    > --
    > jwilliamson
    > ------------------------------------------------------------------------
    > jwilliamson's Profile:
    > http://www.excelforum.com/member.php...o&userid=34493
    > View this thread: http://www.excelforum.com/showthread...hreadid=542593
    >




  3. #3
    Registered User
    Join Date
    05-16-2006
    Posts
    4
    I understand that I will need to do some coding, I just need to know where to start. I have all the data I need in my query, how do I get the query to use Cell A1, A2, A3... and so on to be a parameter for that query. So that when the user types a value in A1, B1-I1 are filled with the data from the query, and the same for A2, A3, etc...

  4. #4
    Tom Ogilvy
    Guest

    Re: Database Linked Spreadsheet

    Are you asking how to concatenate values into a string to be passed as the
    SQL command for the query.

    sSQL = "Select name from table1 where field1 = '" &
    worksheets("Sheet1").Range("A1").value & "'"

    or something of that form.

    --
    Regards,
    Tom Ogilvy


    "jwilliamson" wrote:

    >
    > I understand that I will need to do some coding, I just need to know
    > where to start. I have all the data I need in my query, how do I get
    > the query to use Cell A1, A2, A3... and so on to be a parameter for
    > that query. So that when the user types a value in A1, B1-I1 are filled
    > with the data from the query, and the same for A2, A3, etc...
    >
    >
    > --
    > jwilliamson
    > ------------------------------------------------------------------------
    > jwilliamson's Profile: http://www.excelforum.com/member.php...o&userid=34493
    > View this thread: http://www.excelforum.com/showthread...hreadid=542593
    >
    >


  5. #5
    Registered User
    Join Date
    05-16-2006
    Posts
    4
    Ok...let me try to explain again. We have a production database, on our SQL server. There is information in the database that the managers would like to be able to get on a spreadsheet. They want to be able to open the spreadsheet, click cell A1 and type in a primary key value. When they click another cell, press enter, or whatever the spreadsheet will use the value they typed in A1 and put it in the where clause of a query, that will populate cells B1-H1 with data from the table in the database where the primary key field equals the value they typed in A1. They want to be able to do this in any row of the spreadsheet, A1, A2, A3, etc...How can I create this spreadsheet/query so that it will work how they want it?

  6. #6
    Tom Ogilvy
    Guest

    Re: Database Linked Spreadsheet

    http://tinyurl.com/kac4o

    --
    Regards,
    Tom Ogilvy


    "jwilliamson" <jwilliamson.27x1pm_1147809303.4111@excelforum-nospam.com>
    wrote in message
    news:jwilliamson.27x1pm_1147809303.4111@excelforum-nospam.com...
    >
    > Ok...let me try to explain again. We have a production database, on our
    > SQL server. There is information in the database that the managers
    > would like to be able to get on a spreadsheet. They want to be able to
    > open the spreadsheet, click cell A1 and type in a primary key value.
    > When they click another cell, press enter, or whatever the spreadsheet
    > will use the value they typed in A1 and put it in the where clause of a
    > query, that will populate cells B1-H1 with data from the table in the
    > database where the primary key field equals the value they typed in A1.
    > They want to be able to do this in any row of the spreadsheet, A1, A2,
    > A3, etc...How can I create this spreadsheet/query so that it will work
    > how they want it?
    >
    >
    > --
    > jwilliamson
    > ------------------------------------------------------------------------
    > jwilliamson's Profile:

    http://www.excelforum.com/member.php...o&userid=34493
    > View this thread: http://www.excelforum.com/showthread...hreadid=542593
    >




+ 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