I created an archive process that records every update made to a record. These updates are written to an archive table.
There is a Navigation Drop-Down Menu located on each form. When the Nav Menu changes, and if the form is Dirty, the updated record is copied to the archive table, then moved to the Nav Menu selection. Simple enough.
However, some forms are able to be viewed in a DS format and here is where the problem comes in. If they close the form while in DS view things work OK. However, if they close from Form view I do not want the "Form Before Update" function to run as some updateable fields will no longer be available...the form has already closed.
Is there a way around this?? I want an archive record created when the form is closed OR when the the Nav Menu is used but not both to happen at the same time.
I am currently using the following formatted code:
There is a Navigation Drop-Down Menu located on each form. When the Nav Menu changes, and if the form is Dirty, the updated record is copied to the archive table, then moved to the Nav Menu selection. Simple enough.
However, some forms are able to be viewed in a DS format and here is where the problem comes in. If they close the form while in DS view things work OK. However, if they close from Form view I do not want the "Form Before Update" function to run as some updateable fields will no longer be available...the form has already closed.
Is there a way around this?? I want an archive record created when the form is closed OR when the the Nav Menu is used but not both to happen at the same time.
I am currently using the following formatted code:
Code:
Dim LResponse As Integer
If Me.Dirty Then LResponse = MsgBox("Do you wish to SAVE your changes?", vbYesNo)
If LResponse = vbYes Then 'User chose Yes - Udpated
[txtDateRecordUpdated].Value = Now()
[RecUpdated].Value = True
[txtRecordUpdatedBy].Value = Forms!frmUtility!Full_Name
DoCmd.RunCommand acCmdSave
'The below query looks for a field "RecUpdated" = True then appends this record to the archive table.
DoCmd.OpenQuery "qryAppendArchive_AllActiveArchive_AddUpdatedRec"
[RecUpdated].Value = False
Else 'User chose No - Not Updated
End If
Comment