|
-
Sep 28th, 2013, 10:05 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Object doesn't support this property or method 438
Hi guys.
I've search for this problem but they all talked about Office apps or MSScript which I don't use and no other solution is viable.
I made an app well over 3 years ago and its always worked perfect with a ListView and Webbrowser control along with a DAO database with over 8,000 entries.
I've added HTML links in the code and they all show perfectly. I've since added a links to a pdf file which shows perfectly in the webbrowser but if you click on another item in the ListView it throws back a "Object doesn't support this property or method 438 frmMain lvwCodes_Click" error. It shows this error 4 times so its trying to show 4 items that are causing this error.
Code:
Private Sub lvwCodes_Click()
Dim HTMLString As String
On Error GoTo ErrHandler
If lvwCodes.SelectedItem.Text = vbNullString Then Exit Sub
HTMLString = "<html>"
HTMLString = HTMLString & "<head>"
HTMLString = HTMLString & "<meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html" & Chr(34) & ">"
HTMLString = HTMLString & "</head><body BGCOLOR=white>"
HTMLString = HTMLString & "<div align=left>"
HTMLString = HTMLString & "<font face='Arial' size='2'>"
'HTMLString = HTMLString & "<center><h2>" & "Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
If lvwCodes.SelectedItem.Text = "-" Then
HTMLString = HTMLString & "<center><h2>" & "EOBD II Error Code: " & lvwCodes.SelectedItem.SubItems(1) & "</h2></center><p/><p/>"
Else
HTMLString = HTMLString & "<center><h2>" & "VAG Error Code: " & lvwCodes.SelectedItem.Text & "</h2></center><p/><p/>"
End If
'EOBD II Error Code
If lvwCodes.SelectedItem.SubItems(1) <> "-" Then
HTMLString = HTMLString & "<b>EOBD II Error Code:</b> " & lvwCodes.SelectedItem.SubItems(1) & "<p/><p/>"
End If
'Fault Location
If lvwCodes.SelectedItem.SubItems(2) <> "" Then
HTMLString = HTMLString & "<b>Fault Location:</b><br>" & lvwCodes.SelectedItem.SubItems(2) & "<p/><p/>"
End If
'Possible Cause
If lvwCodes.SelectedItem.SubItems(3) <> "" Then
HTMLString = HTMLString & "<b>Possible Cause:</b><br>" & lvwCodes.SelectedItem.SubItems(3) & "<p/><p/>"
End If
HTMLString = HTMLString & "</font>"
HTMLString = HTMLString & "</div>"
HTMLString = HTMLString & "</body></html>"
' The following statements render the text in the HTMLString
' variable on the WebBrowser control
brwWebBrowser.Document.script.Document.Clear
brwWebBrowser.Document.script.Document.Write HTMLString
brwWebBrowser.Document.script.Document.Close
Exit Sub
ErrHandler:
MsgBox Err.Number & " " & Err.Description, 16, "frmMain lvwCodes_Click"
Open ErrorLog For Append As #1
Write #1, Err.Description & " " & Err.Number & " frmMain lvwCodes_Click"
Close #1
Resume Next
End Sub
I've tried If Err.Number = 438 Then Exit Sub in the error trap but it doesn't allow me to click on another item in the ListView and show the info.
Any suggestions?
There is another slight thing I could do with fixing. The database has 4 Fields VAG, EOBD, Fault Location, Possible Cause.
Now there are always usable values in the VAG and EOBD Fields so I just type in -. If I click on and item that has both VAG and EOBD text it shows the VAG code to centre in bold and the EOBD code next line down. But If there is only EOBD code available it show that in the top centre and again a line lower down. I don't really need to see the EOBD values twice.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|