Forum Discussion

JoeAud's avatar
JoeAud
Copper Contributor
Dec 11, 2020

Update a field in a table from a button on a form

I have a equipment calibration database I am working on. One table holds each tool I calibrate, let’s cal this my EquipmentTBL. The other table holds my calibration data from each calibration, we will call this my CalibrationTBL. For each table I have a form to enter my information. I want the Calibration table form, CalibrationFRM to have a button that will update that piece of equipment in the equipment table with the date I put in the calibration form.

To help here, the date I put in the calibration form that I want to be updated in the equipment table, calculates the next calibration due date field in the equipment table, based on the cycle I give that equipment in the CalCycle field of the equipment table.

Hope someone can help
  • George_Hepworth's avatar
    George_Hepworth
    Silver Contributor

    JoeAud 

    Typically, we do NOT store calculated values in tables. Your field "Next Calibration Date" is a calculated field and should not be used. The better approach--the one followed by professional Access relational database application developers--is to perform calculations like this ONLY in queries for DISPLAY on forms or reports. 

    So, my response would be to remove that field from the table rather than try to add additional complexity to the application with this step. 

    • George_Hepworth's avatar
      George_Hepworth
      Silver Contributor

      George_Hepworth 

      I should be a bit more accurate. You can calculate the "Next Calibration Date" in a query, but it can also be calculated in a control on a form or in a report.

Resources