Results 1 to 5 of 5
  1. #1
    PMal is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2022
    Posts
    12

    Update Fields From Latest Entry of Another Table

    I have 2 tables, the first is a list of items (table1), the second is a list of maintenance for said items (table2). so an item has a maintenance task either every month or year. The tables are linked by the serial number of the items.

    So table1 will have item 1, item1 has 4 entries in table2, (2018, 2019, 2020 & 2021).

    I have a field in table1 which is basically 'date last maintained'.

    I want table1 to automatically update with the latest maintenance date for all items when an entry is made to table2. I know of update queries and Dlookups (not sure either are relevant and would help me) if someone could point me in the right direction for completing such a task?



    Thank s very much.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,943
    You do not do it.
    You just look up the max date from table 2 for relevant item any time you want to know what it is. That way it always remains current. If you store a calculated/lookup value, it can easily get out of sync/date.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    PMal is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2022
    Posts
    12
    Quote Originally Posted by Welshgasman View Post
    You do not do it.
    You just look up the max date from table 2 for relevant item any time you want to know what it is. That way it always remains current. If you store a calculated/lookup value, it can easily get out of sync/date.
    Thanks for your response.

    If that's the case, I have a report to show 'Expired items', when the last maintenance point + the set interval has passed. (Last event: 01/01/22+ 6 month interval = Due date of 01/07/22). Any pointers on how I could work my report if I don't have an expired date?

    An option is to enter both fields manually but I want to avoid duplicate inputs if I can as we know this leaves massive room errors/forgetfulness.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,943
    You bring it into the query that supplies the data for the report.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    What is 'expired date'? If it's the same as the due date and you're calculating that, then you also have the expired date? Then put an unbound textbox in the report with that calculation as the control source.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Get latest entry in table for each car
    By tagteam in forum Access
    Replies: 19
    Last Post: 03-16-2018, 08:19 AM
  2. Replies: 11
    Last Post: 12-15-2017, 04:06 PM
  3. Replies: 2
    Last Post: 10-14-2016, 05:05 AM
  4. Replies: 3
    Last Post: 09-27-2016, 11:25 AM
  5. Capturing Latest Entry on Subform
    By Marie1106 in forum Forms
    Replies: 3
    Last Post: 02-21-2012, 10:40 AM

Tags for this Thread

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