SqlStr = "SELECT p.Priority_Desc AS 'Priority', s.Status_Desc AS 'Status', "
SqlStr = SqlStr & "h.User_Login AS 'User', l.Workstation AS 'Workstation', "
SqlStr = SqlStr & "l.Title AS 'Title', c.Cat_Desc AS 'Category', "
SqlStr = SqlStr & "sc.SubCat_Desc AS 'SubCategory', l.Closed_Date As 'Closed_Date', "
SqlStr = SqlStr & "r.Res_Desc AS 'Resolution', l.Error_Num AS 'Error_Num', "
SqlStr = SqlStr & "l.Error_Src AS 'Error_Src', l.Error_Desc AS 'Error_Desc', "
SqlStr = SqlSTr & "l.Module AS 'Module', l.Process AS 'Process', l.Ticket_Date AS 'Ticket_Date', "
SqlStr = SqlStr & "l.Resolved_Date AS 'Resolved_Date', l.Account AS 'Account' "
SqlStr = SqlStr & "FROM ((((((ticket_log l INNER JOIN ticket_priority p "
SqlStr = SqlStr & "ON l.Priority = p.Priority_ID) INNER JOIN ticket_status s "
SqlStr = SqlStr & "ON l.Status = s.Status_ID) INNER JOIN ticket_category c "
SqlStr = SqlStr & "ON l.Category = c.Cat_ID) INNER JOIN ticket_subcategory sc "
SqlStr = SqlStr & "ON l.SubCategory = sc.SubCat_ID) INNER JOIN helpdesk_user h "
SqlStr = SqlStr & "ON l.User = h.User_ID) INNER JOIN resolution_code r "
SqlStr = SqlStr & "ON l.Resolved_Code = r.Res_ID) WHERE l.ID = " & TicketNumber
RSTicket = HelpDeskCN.Execute(SqlStr)
' *********************************************************************
' ** After executing the above line, the IDE shows me the String **
' ** value of RSTicket.Fields("Error_Desc").Value in my Watch window.**
' ** **
' ** As soon as it moves to the next instruction, the Watch shows **
' ** the value change to {System.DBNull} **
' *********************************************************************
Application.DoEvents()
If Not RSTicket.EOF Then
If Not IsDBNull(RSTicket.Fields("Title").Value) Then Title = RSTicket.Fields("Title").Value
If Not IsDBNull(RSTicket.Fields("User").Value) Then ReportedBy = RSTicket.Fields("User").Value
If Not IsDBNull(RSTicket.Fields("Workstation").Value) Then ComputerID = RSTicket.Fields("Workstation").Value
If IsNumeric(RSTicket.Fields("Error_Num").Value) Then ErrorNum = RSTicket.Fields("Error_Num").Value
If Not IsDBNull(RSTicket.Fields("Error_Src").Value) Then ErrorSrc = RSTicket.Fields("Error_Src").Value
' *********************************************************************
' ** By the time it gets down here, it truly believes it is a null **
' ** field. Requerying the recordset doesn't help. Nor does setting**
' ** up another, completely separate recordset with just this field. **
' *********************************************************************
If Not IsDBNull(RSTicket.Fields("Error_Desc").Value) Then ErrorDesc = RSTicket.Fields("Error_Desc").Value
If Not IsDBNull(RSTicket.Fields("Module").Value) Then ErrorMod = RSTicket.Fields("Module").Value
If Not IsDBNull(RSTicket.Fields("Process").Value) Then ErrorProc = RSTicket.Fields("Process").Value
If IsDate(Format((RSTicket.Fields("Ticket_Date").Value), "MM/dd/yyyy hh:mm:ss")) Then OpenedDate = Format((RSTicket.Fields("Ticket_Date").Value), "MM/dd/yyyy hh:mm:ss")
If Not IsDBNull(RSTicket.Fields("Priority").Value) Then TicketPriority = RSTicket.Fields("Priority").Value
If Not IsDBNull(RSTicket.Fields("Status").Value) Then TicketStatus = RSTicket.Fields("Status").Value
If Not IsDBNull(RSTicket.Fields("Category").Value) Then TicketCategory = RSTicket.Fields("Category").Value
If Not IsDBNull(RSTicket.Fields("SubCategory").Value) Then TicketSubCategory = RSTicket.Fields("SubCategory").Value
If Not IsDBNull(RSTicket.Fields("Resolution").Value) Then TicketResolution = RSTicket.Fields("Resolution").Value
If Assigned Then AssignedTo = RSTicket.Fields("Assigned").Value