I have a couple of questions for those who have successfully utilized the Listview control on their projects...

1. I would like to center the data within the Listview so that it is centered under it's appropriate ListItem..( not a major one for the completion of my project...)

2. I need to round up the values that come from my SQL, which fill the ListView...( this is important)...I know there are Round functions, but I have not been successful with it...

I have 3 fields that I need to round up to the 2nd decimal place...i.e: 35.66666677 to 35.67

I tried to create 3 double variables then set the variables to the value coming from the recordsets...

But I keep running into NULL values, which there very well maybe NUll coming from the SQL statement...

This is the code I have...now it is long so please be forgiving
VB Code:
  1. Dim pitmQuality As ListItem
  2.     Dim prstQuality As New ADODB.Recordset
  3.     Dim qPhone As Double, qEmail As Double, qMail As Double
  4.    
  5.     Qssql = "Select AVG (Phone)  as PHONE , AVG(Mail) as MAIL, AVG (Email) as EMAIL , AVG (ACW) as ACW, AVG (AUX) as AUX, AVG (ACD) as ACD, AVG (Talk) as Talk, " _
  6.             & "RepName from ( Select [Phone Score 1] as Phone ,[Mail Score 1] as Mail , [Email Score 1] as Email , [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  7.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union All Select [Phone Score 2] as Phone ,[Mail Score 2] as Mail , " _
  8.             & "[Email Score 2] as Email , [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  9.             & "Union All Select [Phone Score 3] as Phone ,[Mail Score 3] as Mail ,[Email Score 3] as Email ,[ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  10.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 4] as Phone, [Mail Score 4] as Mail, " _
  11.             & "[Email Score 4] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  12.             & "Union ALL Select [Phone Score 5] as Phone, [Mail Score 5] as Mail, [Email Score 5] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  13.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 6] as Phone, [Mail Score 6] as Mail, " _
  14.             & "[Email Score 6] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  15.             & "Union ALL Select [Phone Score 7] as Phone, [Mail Score 7] as Mail, [Email Score 7] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  16.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 8] as Phone, [Mail Score 8] as Mail, " _
  17.             & "[Email Score 8] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  18.             & "Union ALL Select [Phone Score 9] as Phone, [Mail Score 9] as Mail, [Email Score 9] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  19.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 10] as Phone, [Mail Score 10] as Mail, " _
  20.             & "[Email Score 10] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  21.             & "Union ALL Select [Phone Score 11] as Phone, [Mail Score 11] as Mail, [Email Score 11] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  22.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 12] as Phone, [Mail Score 12] as Mail, " _
  23.             & "[Email Score 12] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  24.             & "Union ALL Select [Phone Score 13] as Phone, [Mail Score 13] as Mail, [Email Score 13] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  25.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' Union ALL Select [Phone Score 14] as Phone, [Mail Score 14] as Mail, " _
  26.             & "[Email Score 14] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "' " _
  27.             & "Union ALL Select [Phone Score 15] as Phone, [Mail Score 15] as Mail, [Email Score 15] as Email, [ACW] as ACW, [AUX] as AUX, [ACD] as ACD, [TalkTime] as Talk, " _
  28.             & "RepName from tblHBUS WHERE MonthYear = 'Mar 2004' AND [Unit Manager] = '" & mgrName & "') as MyTemp group by RepName"
  29.  
  30.     Set prstQuality = New ADODB.Recordset
  31.     prstQuality.Open Qssql, CN, adOpenDynamic, adLockOptimistic
  32.    
  33.     qPhone = prstQuality("Phone")  ' here is where the error Invalid use of NULL occurs
  34.     qEmail = prstQuality("Email")
  35.     qMail = prstQuality("Mail")
  36.    
  37.     'lvwAgents.Icons = ilsLargeIcons
  38.     'lvwAgents.SmallIcons = ilsSmallIcons
  39.     lvwAgents.View = lvwReport
  40.     lvwAgents.ListItems.Clear
  41.     'create headers
  42.     lvwAgents.ColumnHeaders.Clear
  43.     lvwAgents.ColumnHeaders.Add , , "Rep Name", 1500
  44.     lvwAgents.ColumnHeaders.Add , , "ACW", 1000
  45.     lvwAgents.ColumnHeaders.Add , , "AUX", 1000
  46.     lvwAgents.ColumnHeaders.Add , , "ACD Calls", 1000
  47.     lvwAgents.ColumnHeaders.Add , , "AVG Talk Time", 1400
  48.     lvwAgents.ColumnHeaders.Add , , "AVG Phone Scores", 1400
  49.     lvwAgents.ColumnHeaders.Add , , "AVG Email Scores", 1400
  50.     lvwAgents.ColumnHeaders.Add , , "AVG Mail Scores", 1400
  51.    
  52.        'add list items
  53.        
  54.     Do Until prstQuality.EOF
  55.         Set pitmQuality = _
  56.             lvwAgents.ListItems.Add()
  57.         pitmQuality.Text = prstQuality("RepName")
  58.         pitmQuality.ListSubItems.Add , "ACW", _
  59.                 prstQuality("ACW") & ""
  60.             pitmQuality.ListSubItems.Add , "AUX", _
  61.                 prstQuality("AUX") & ""
  62.             pitmQuality.ListSubItems.Add , "ACD", _
  63.                 prstQuality("ACD") & ""
  64.             pitmQuality.ListSubItems.Add , "Talk Time", _
  65.                 Format(prstQuality("Talk"), "hh:mm") & ""
  66.             pitmQuality.ListSubItems.Add , "Phone", _
  67.                 Round(qPhone,2) & ""    ' I can not even get to this part
  68.             pitmQuality.ListSubItems.Add , "Email", _
  69.                 qEmail & ""
  70.             pitmQuality.ListSubItems.Add , "Mail", _
  71.                 qMail & ""
  72.  
  73.        
  74.         prstQuality.MoveNext
  75.     Loop
So this is where I am at...thanks in advance!