I have a form that has a header. In the header is an unbound textbox that is used to search for a particular record. In the form properties is a BeforeUpdate sub to capture last update. The sub is:
Private Sub Form_BeforeUpdate (cancel as integer)
Me![DateLastUpdated].Value = Now()
Everything works fine if you move to another record using PgUp/Dn or other keystrokes. However, if after you update a record, you mouseclick to the header to search for another record, the update function abends and the form does not get saved. Is there a way of triggering the sub when switching to the form header? I assumed that Me! referred to the record that was in the form regardless of whether you were in the header, detail, or footer, but apparently that is not so.
Me! in a VBA proc behind a form or report refers to the controls on the form itself. It's like saying Forms!<NameOfCurrentForm>! Ditto with reports. if you're interested in recent information, you have to either save it separately in a memory variable or search for it in a table.
In your particular case, you might be safer using a preliminary form to find a data record, and a separate form to contain that record, update it, and process/save it. Then close the processing form and return to the preliminary form before accessing another record.
'Abends,' eh? I haven't heard that term since 1999 when I graduated from Technology class.