Results 1 to 4 of 4
  1. #1
    Scorpio11 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Location
    Cape Town, ZAR
    Posts
    36

    Update Field list in Table with Query

    Is it possible to update the field listing of a table based on the data stored in another table.



    I am building something that involves shares and stocks. When i purchase another stock - I would record the details of the stock in Table 1 then I would like it to be able to add a new field in Table 2 where i can record the daily closing price.

    The closest i can find is an update query, but that only updates values in a table, not the actual table itself.....

    Any help would be appreciated.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What I would do is create the table with stock info like you have. I would create a second table with fields

    StockTrackID (autonumber PK)
    StockID (FK)
    OpenPrice
    ClosePrice
    Date

    You create a 1-M relationship between the tables. You run an INSERT INTO query (most likely off of a form) to add fields to the second table. I hope I'm getting the gist of what youre trying to accomplish.

  3. #3
    Scorpio11 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Location
    Cape Town, ZAR
    Posts
    36
    I follow what you are suggesting and in theory does sound like it could work - my only issue is the INSERT INTO query - i don't know how to do that - i don't see that option as a query type. An i don't know how to build a query..? any suggestions?

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    you would have to do it in VBA. i really cant write it out for you without seeing the db. look up...
    http://www.blueclaw-db.com/accessque...nsert_into.htm
    for the insert into. also look up how to put variables into a string. get started on that, get a rough sql string made up and i can fine-tune it for ya.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  2. Replies: 3
    Last Post: 04-14-2010, 10:07 AM
  3. Replies: 4
    Last Post: 09-03-2009, 02:01 PM
  4. Replies: 1
    Last Post: 03-08-2009, 01:50 PM
  5. how to update only one field in 1 table?
    By viccop in forum Access
    Replies: 3
    Last Post: 02-21-2009, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums