Queue example

The following code illustrates the use of queues in FORMS.

Sub SendFormToQueue()

'----------------------------------------------------------------------

' Call this function in the FormValidated event in the

' Interpret module.

' All forms are sorted into a queue depending on their status after

' interpretation and validation in the Interpret module.

'----------------------------------------------------------------------

    Dim objCurrForm As Object

    Dim intStatus As Integer

    Dim intQueueNo As Integer

 

    Set objCurrForm = InterpretApp.Form

    intStatus = objCurrForm.Status

 

    Select Case intStatus

        Case ehComplete

            intQueueNo = ehQueue1

        Case ehIncomplete

            intQueueNo = ehQueue2

        Case ehInterpretError

            intQueueNo = ehQueue3

        Case ehValidationError

            intQueueNo = ehQueue4

        Case ehRetype

            intQueueNo = ehQueue5

        Case ehMassVerify

            intQueueNo = ehQueue6

        Case Else

            intQueueNo = ehNoQueue

   End Select

 

    If intQueueNo <> ehNoQueue Then

        objCurrForm.Queue = intQueueNo

    End If

 

End Sub