Good morning,
I am using the below. But I am throwing an error at sub item 21 and 22. When I go into debug mode and hover over 21 & 22, it states Invalid Property Value. However if I hover of the Field portion I see the value in the DB. I can't figure out whats going on!!
Any thoughts?
I am using the below. But I am throwing an error at sub item 21 and 22. When I go into debug mode and hover over 21 & 22, it states Invalid Property Value. However if I hover of the Field portion I see the value in the DB. I can't figure out whats going on!!
Any thoughts?
Code:
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Dim myConn As ADODB.Connection
Set myConn = New ADODB.Connection
myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\Business Intelligence\VB6\FHA\Database9.mdb;"
myConn.Open
Dim strSQL As String 'our query string
Dim oRS As ADODB.Recordset 'our recordset object
Dim lvwItem As ListItem 'this is necessary to directly reference the ListView control
Set oRS = New ADODB.Recordset
Screen.MousePointer = vbHourglass
'change this SQL as appropriate for your needs
strSQL = "SELECT Identifier, Date_Entered, Request_Type, Loan_Number, FHA_Case_Number, Extension_Request_Date, State, Case_Manager, Loan_Status, Comment_Code, Step_Code, Response_Code, Appraisal_Amount, Haircut_Amount, Bid_Amount, DDPLI_Date, First_Legal_Date, Actual_First_Legal, Due_Date, Referral_date, Final_Status, Extension_Expiration_Date, Notes FROM FHATracker "
'change oConn to reflect the Connection object you are using in your program
oRS.Open strSQL, myConn
ListView1.ListItems.Clear
'load the listview
Do While Not oRS.EOF
Set lvwItem = ListView1.ListItems.Add(, , Format(oRS.Fields.Item("Date_Entered").Value, "mm/dd/yyyy"))
lvwItem.SubItems(1) = oRS.Fields.Item("Request_Type").Value & ""
lvwItem.SubItems(2) = oRS.Fields.Item("Loan_Number").Value & ""
lvwItem.SubItems(3) = oRS.Fields.Item("FHA_Case_Number").Value & ""
lvwItem.SubItems(4) = oRS.Fields.Item("Extension_Request_Date").Value & ""
lvwItem.SubItems(5) = oRS.Fields.Item("State").Value & ""
lvwItem.SubItems(6) = oRS.Fields.Item("Case_Manager").Value & ""
lvwItem.SubItems(7) = oRS.Fields.Item("Loan_Status").Value & ""
lvwItem.SubItems(8) = oRS.Fields.Item("Comment_Code").Value & ""
lvwItem.SubItems(9) = oRS.Fields.Item("Step_Code").Value & ""
lvwItem.SubItems(10) = oRS.Fields.Item("Response_Code").Value & ""
lvwItem.SubItems(11) = oRS.Fields.Item("Appraisal_Amount").Value & ""
lvwItem.SubItems(12) = oRS.Fields.Item("Haircut_Amount").Value & ""
lvwItem.SubItems(13) = oRS.Fields.Item("Bid_Amount").Value & ""
lvwItem.SubItems(14) = oRS.Fields.Item("DDPLI_Date").Value & ""
lvwItem.SubItems(15) = oRS.Fields.Item("First_Legal_Date").Value & ""
lvwItem.SubItems(16) = oRS.Fields.Item("Actual_First_Legal").Value & ""
lvwItem.SubItems(17) = oRS.Fields.Item("Due_Date").Value & ""
lvwItem.SubItems(18) = oRS.Fields.Item("Referral_Date").Value & ""
lvwItem.SubItems(19) = oRS.Fields.Item("Final_Status").Value & ""
lvwItem.SubItems(20) = oRS.Fields.Item("Extension_Expiration_Date").Value & ""
lvwItem.SubItems(21) = oRS.Fields.Item("Notes").Value & ""
lvwItem.SubItems(22) = oRS.Fields.Item("Identifier").Value & ""
oRS.MoveNext
Loop
oRS.Close