Results 1 to 9 of 9
  1. #1
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35

    Exclamation Update field on separate table if result from form equals certain criteria

    Hi All,


    I have a form, which i use to book in products received. What i want to do is if the quantity received is equal to what was ordered then i'd like to update a yes/no field (Order Complete) on a separate table to true.

    I cannot seem to get this to work no matter what i try...
    Any help would be greatly appreciated.

    Thanks in advance....

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,927
    Would need to know your data structure to advise on specifics. Do you want to provide the project for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    AcsDb Guest
    Windows 7 64bit Access 2010 32bit
    Have you tried running an query in SQL via VBA?

  4. #4
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    Hi,
    I have already tried, but the table is not linked in a relationship so will not work. I may have to redesign the table to allow for orders and transactions..
    The structure i have at the moment is:

    1. tblorders
    2. tblorderdetails
    3. tblgoodsin

    i have attached an image of the relationship table to show the connections between tables. You will see that the goodsin tbl is only linked to the muster list via the ProductID.

    Click image for larger version. 

Name:	relationship.jpg 
Views:	13 
Size:	78.9 KB 
ID:	6784

    Any thoughts???

    What i meant to add is:
    The field i'd like to update is the Order Complete field on the OrderDetails Table.
    I have the following in the recordsource for the form:
    SELECT [Goods In].[GI No], [Goods In].[Product ID], [Goods In].[Quantity Received], [Goods In].[Quantity Rejected], [Muster List].[Stock Location], [Goods In].[Date Received], [Muster List].UnitsInStock, [Muster List].[Units On order], [Muster List].[Quantity Received]
    FROM [Goods In] INNER JOIN [Muster List] ON [Goods In].[Product ID] = [Muster List].[Product ID];

    Now if i add the Ordercomplete field to this i get in the status bar, recordset not updateable.
    Last edited by 1eye1vision; 03-18-2012 at 10:21 AM. Reason: forgot to add

  5. #5
    AcsDb Guest
    Windows 7 64bit Access 2010 32bit
    --------------

  6. #6
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    The problem is if i don't store this value, when i print out a list of outstanding orders it will display all the orders. This way i could filter out what has been completed and what's not..

    This was the only way i could think of doing this
    Last edited by pbaldy; 03-18-2012 at 10:46 AM. Reason: link deleted

  7. #7
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    ok thanks will take another look and see if i can figure this out.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,927
    An OrderComplete field should be in the Orders table, not OrderDetails repeating for each line item of the order. A status field in OrderDetails should indicate status of the specific item (sent, backordered, canceled). Then determining if Order is incomplete can be shown by a query that has criteria to return Order records based on OrderDetails Status field.

    Requisitions to replenish inventory do not need to relate back to specific customer orders.

    Maintaining aggregate data such as UnitsInStock is problematic. Ideally, in/out transactions (purchases/sales) records would be summed by product and the balance calculated whenever needed to determine stock levels.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I don't understand GoodsIn and Muster List

    Sounds like Goodsin is an Inventory type table. And you would have 2 basic transactions
    Add Product to Inventory, Remove Product from Inventory.

    You might get some design ideas from the model here http://www.databaseanswers.org/data_...ucts/index.htm

    It deals with more things than you, but shows Customers, Products, Orders ,OrderItems(Details).

    As has been said, lack of Normaliztion (fields in more than 1 place), will cause you grief.

    Good luck with your project.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2013, 11:42 AM
  2. Replies: 3
    Last Post: 11-07-2011, 10:41 AM
  3. Form using VBA to update field on table
    By comicwizard in forum Programming
    Replies: 3
    Last Post: 04-05-2011, 11:17 AM
  4. Programming a result field in a table
    By Linda in forum Programming
    Replies: 9
    Last Post: 07-13-2009, 08:07 PM
  5. Update table from calculated field in a form
    By BernardKane in forum Forms
    Replies: 3
    Last Post: 11-28-2006, 09:48 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