none
Keeping date in form after update RRS feed

  • Question

  • I have form that has buttons that update data files. I have created a label on the form that records the last date/time the update was run for eact button.

    I can set the value to the label to Now() when running the macro thatupdates, and the date/time is set on form.

    However, when I close the form , all the set date/time values are lost.

    Is there a way to keep the values on the form until the macro is run again, and sets the date time in the filed ?

    Any help would be appreciated.

    Thanks.

    Friday, August 31, 2018 1:46 PM

All replies

  • Hi,

    The most common method to persist a value for a form is to store it in a table. If you're not recording the date in a table now, you might consider doing it. Otherwise, you can use either DLookup() or DMax() to retrieve the date back from the table or simply bind the form to the table with the dates.

    Hope it helps...

    Friday, August 31, 2018 2:26 PM
  • In addition to @.theDBguy's answer:

    It depends on the necessary lifetime of your variables.

    If it should be available after you close and open Access, then you need to store it in a table.
    When it is sufficient to have it only during the application is running, then you can use TempVars and the SetTempVar macro action.

    Friday, August 31, 2018 2:59 PM