Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Exclamation Unanswered: Can I update a table field with a query result using VB in access?

    Can I use VB inside access to update a table field with a query result (query uses SUM). I'm using Access 2002.

    TIA, Gareth

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I have no clue what you're asking.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Oct 2004
    Posts
    11
    I want to access a table field through a vbscript attached to a form button in access, I then want to insert this value in to another table.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    So you want to create normalization issues?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Oct 2004
    Posts
    11
    I just want to take the result of a query (which uses SUM) and enter that into a table. That's all. I can't find out how to do it anywhere. I tried an update statement but it didn't work.

  6. #6
    Join Date
    May 2004
    Location
    NH
    Posts
    87
    Can you please explain what you want to do... there are multiple ways to update tables with VB?

  7. #7
    Join Date
    Oct 2004
    Posts
    11
    Ok I want to SUM a column and then take that total and put it in another table. I've tried using an UPDATE query with SUM but it doesn't work...
    The column holds amounts of money, my query SUM's this column with two conditions; Condidtion one, if the 'paid' column value is TRUE and condition two, if the 'used' column is false (so the same record is not used twice). I want to take the result and enter it into another table named 'balance'. This table may already contain a value so I first want to retrive that value and add it to my total.

    TIA, Gareth.

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    As I indicated in your other thread, this is a very VERY bad idea. You are introducing massive probability for normalization issues. You should never store static data that comes from dynamic sources. If you can derive the number you want from information already in the database, you shouldn't be storing it as a static number somewhere else.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  9. #9
    Join Date
    Oct 2004
    Posts
    11
    I don't get what you mean. I just need to get the SUM of a column and store it in another table to keep track of the balance, nothing will be static. It's for my cousins garage and I can't find answers anywhere. I want to keep everything internal. Is there anyway to access table data from with vba and then insert (update whatever) it into another table withing access?

  10. #10
    Join Date
    Oct 2004
    Posts
    11
    The data won't be static, eventually job (the table with cost, paid and used in) records will be deleted but there value must stay in the balance table, it accumulates an amount... The used flag will stop the same record being entered twice.

Posting Permissions

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