Case "btnDisplayExceptionList"
Dim i As Long
Dim sMessageHeader As String
Dim sMessageBody As String
Dim sMessageFooter As String
Dim sMessage As String
Dim oQueryResults As CscXDocField
Set oQueryResults = SQLDBQuery(Project.Databases.ItemByName("Exceptions_SQL"), True)
For i = 0 To oQueryResults.Alternatives.Count - 1
sMessageHeader = pxDoc.Fields.ItemByName("KC_CompanyEntity1").Text & " exceptions are listed below..." & vbCr
sMessageFooter = "NOTE: Some exceptions are checked and applied after validation is completed."
sMessageBody = sMessageBody & oQueryResults.Alternatives.ItemByIndex(i).SubFields.ItemByName("ExceptionCode").Text & " - " & oQueryResults.Alternatives.ItemByIndex(i).SubFields.ItemByName("ExceptionDescription").Text & vbCr
sMessage = sMessageHeader & vbCr & sMessageBody & vbCr & sMessageFooter & vbCr
Next
MsgBox (sMessage, vbInformation , "Exceptions List")