Results 1 to 5 of 5
  1. #1
    s60293jp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    3

    Stock update in access 2010

    Hi,


    I have prepared two access database named "Stock" (field - "S_ID", "Item_Name", "StockQty"), "Received" (field - "R_ID", "Item_Name", "ReceivedQty").
    Now my question is how can I update the Stockqty with the help of ReceivedQty? Is there any VBA code which will help me to solve the problem.

    Thanks

    Regards
    s60293jp

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Normally we refer to a Database that contains Tables. In you case, it appears yo have table Stock and table Received.
    If you want to UPDATE a field(s) in one table based on values in a related table, you would use an UPDATE query.

    What exactly is the field that relates these tables?

    Have you considered those Transactions where items are removed from Stock and sold to Customer....?

    research/google "SQL Update query 2 tables example"

  3. #3
    s60293jp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    3
    Thank for your reply
    1) The tables are relationed on "S_ID" from Table Stock and "R_ID" from Table Received as one to many.
    2) Transactions - items are removed from Stock and sold to Customer would be done through another table named "Table Issue" where the relation with the "Table Stock" is on "S_ID" and "I_ID" as one to many.
    3) I have gone through "SQL Update query 2 tables example", but here I need only VBA Code. Is there any link to wite the SQL statement here? I have no SQL server.

    Thanks
    Regards
    s60293jp

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    I'm not following your comments.
    You can have a TblInventory ans a TblTransaction.

    POsitive transaction will increase Inventory, and negative transactions reduce inventory.

  5. #5
    s60293jp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    3
    Hi everybody,

    Yes, your are right.

    thank you

    regards

    s60293jp

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

Similar Threads

  1. Replies: 1
    Last Post: 08-09-2012, 03:51 PM
  2. Replies: 3
    Last Post: 03-15-2012, 03:42 PM
  3. Stock Update using VBA in Access 2007
    By thanosgr in forum Access
    Replies: 19
    Last Post: 02-13-2012, 03:21 PM
  4. SQL Update stock Query HELP!!!
    By jordanturner in forum Queries
    Replies: 6
    Last Post: 09-06-2010, 10:34 AM
  5. Running update query in access 2010
    By dbansal in forum Queries
    Replies: 1
    Last Post: 09-03-2010, 10:57 AM

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