Processing the Message_OnChange Event

After a user opens a critique, the user's identity is checked and the appropriate form page is displayed. If the person opening the critique is the same as the person who originally posted it, the HalfRead page of the EnhancedLitCrit form is opened. This page has no means for posting a critique, only for closing a critique. When the Close button is clicked, a Message_OnChange event is triggered, not a Folder_OnMessageCreated event. When a user is submitting a critique for the first time, closing the form or clicking Save treats the form as a new posting; that is, the Folder_OnMessageCreated event is triggered.

For these reasons, it is assumed in the Message_OnChange subroutine that the critique is a resubmission. In the GetPropertiesFromLitCrit subroutine, which is called by Message_OnChange, the value of the hidden ApprovalRequired field on the message is retrieved. Message_OnChange checks this value, and if approval is required, it calls the CopyToApprover and SendApproverForm subroutines to create a ToApprover form and send it on to the designated administrator. Finally, it deletes the saved message from the LitCrit public folder; the critique will return if it is approved.

If approval of critiques was not required when this message was created (which is when the ApprovalRequired variable is set on the message), the server-side Critique COM component is instantiated and its UpdateRecord method is called, to update the record of this critique in the critique table with its vital information.