msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ListView Element not found error

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
Greg



Joined: 04 Oct 2007
Posts: 2

PostPosted: Tue Sep 26, 2006 1:40 pm    Post subject: ListView Element not found error Reply with quote

I have created a list view on a form and added the imgVLsort control,
when I try to load the form I get the Run-time error 35601 Element not
found. Here is my code;

Private Sub Form_Load()


'---------------------------------------------------------------------------------------
' Procedure : Form_Load (Sub)
' Purpose : Initialization

'---------------------------------------------------------------------------------------
'modified by NE4848

Dim llngSaveCount As Long
Dim lblnProfileChecked As Boolean


Me.WindowState = VBRUN.vbMaximized
' get error object
Set myError = basMain.GetErrorObject
' get database connection
Set myDatabase = basMain.GetDatabaseObject
' application logging?
myError.Raise ERROR_REPORT_PUBLISH_STARTING,
"frmPublishMetricsReport:Form_Load", "Starting"
' prompt when cancel
mblnCancel = True
' prepare listview
lvwMetricsProfiles.Enabled = True
' redraw checkboxes, or they will remain gray
lvwMetricsProfiles.CheckBoxes = False
lvwMetricsProfiles.CheckBoxes = True
With lvwMetricsProfiles
.ColumnHeaders.Clear
' setup columns
.ColumnHeaderIcons = Nothing
.ColumnHeaderIcons = imgLVsort
'.ColumnHeaders.Count

.ColumnHeaders.Add , , "Profile Name", 3000, , "None"
.ColumnHeaders.Add , , "ReportID", 1300, MSComctlLib.lvwColumnLeft,
"None"
.ColumnHeaders.Add , , "W", 850, MSComctlLib.lvwColumnRight, "None"
.ColumnHeaders.Add , , "MW", 850, MSComctlLib.lvwColumnRight,
"None"
.ColumnHeaders.Add , , "SW", 850, MSComctlLib.lvwColumnRight,
"None"
.ColumnHeaders.Add , , "E", 850, MSComctlLib.lvwColumnRight, "None"
.ColumnHeaders.Add , , "Interval", 1300,
MSComctlLib.lvwColumnRight, "None"
.ColumnHeaders.Add , , "DueDate", 1300, MSComctlLib.lvwColumnRight,
"None"
.ColumnHeaders.Add , , "Priority", 1300,
MSComctlLib.lvwColumnRight, "None"
.ColumnHeaders.Add , , "Calendar", 1300,
MSComctlLib.lvwColumnRight, "None"
' columnheader icons
.ColumnHeaders(LV_RPT_ID).Tag = 0
.ColumnHeaders(LV_RPT_ID).Icon = "Ascending"
' other settings
.AllowColumnReorder = True
' A bug:
http://support.microsoft.com/support/kb/articles/q143/4/06.asp
.Arrange = MSComctlLib.lvwAutoTop
.CheckBoxes = True
.FullRowSelect = True
.HideSelection = False
.LabelEdit = MSComctlLib.lvwManual
.MultiSelect = True
.Sorted = True
.View = MSComctlLib.lvwReport
End With 'lvwMetricsProfiles
' populate comboboxes
Combobox_Defaults
' disable run/prompt

cmdRun.Enabled = False
chkPrompt.Enabled = False
' disable cancel button
cmdCancel.Enabled = False
' call get_rpt_profiles to populate listview with current list of
report profiles.
If myDatabase.CallStoredProcedure("CPAT.GET_METRICS_RPT_PROFILES",
mrsTemp) 0 Then
myError.Raise ERROR_GENERIC, "frmPublishMetricsReport:Form_Load", _
"GET_METRICS_RPT_PROFILES database error", , True
MainEnd
End If
' 20050720 rl8419 begin handle no recordset error
If mrsTemp Is Nothing Then
' If mrsTemp.RecordCount = 0 Then
' 20050720 rl8419 end
myError.Raise ERROR_NOREPORT_PROFILES,
"frmPublishMetricsReport:Form_Load", _
"No Metrics Report Profiles, EXITING...", True, True
MainEnd
Else 'NOT MRSTEMP.RECORDCOUNT...
'LV_Profiles_Refilter
End If ' mrsTemp Is Nothing
' status bar
frmmdiMainGMCCA.UpdateStatusBar ("Choose Metrics Report Profile(s)")
lvwMetricsProfiles.Enabled = False

'01092005 NE4848 BEGIN
If blnSaveNReport Then
blnSaveNReport = False
' If lngSaveNReportInt = "M" Then
' cboInterval.text = "M"
' Else
' cboInterval.text = "Q"
' End If

For llngSaveCount = 1 To lvwMetricsProfiles.ListItems.Count
If
lvwMetricsProfiles.ListItems(llngSaveCount).ListSubItems(LV_RPT_ID).text
= lngSaveNReportID Then
lvwMetricsProfiles.ListItems(llngSaveCount).Checked = True
lblnProfileChecked = True
Exit For
End If
Next llngSaveCount

' If lblnProfileChecked = False Then
' cboInterval.text = "All"
' End If
End If
'01092005 NE4848 END

End Sub ' Form_Load()

I havve list views on several other forms and all have the same
properties etc. but no errors.

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Ken Halter



Joined: 04 Oct 2007
Posts: 4150

PostPosted: Tue Sep 26, 2006 1:47 pm    Post subject: Re: ListView Element not found error Reply with quote

"Greg" wrote in message @h48g2000cwc.googlegroups.com...
>I have created a list view on a form and added the imgVLsort control,
> when I try to load the form I get the Run-time error 35601 Element not
> found. Here is my code;

imgVLsort control? Even with the code you posted, we can't duplicate the
problem without your database so.... the only thing I can suggest is, single
step through and find out why you're getting the error.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Back to top
View user's profile Send private message
Greg



Joined: 04 Oct 2007
Posts: 2

PostPosted: Tue Sep 26, 2006 2:04 pm    Post subject: Re: ListView Element not found error Reply with quote

Like an idiot I forgot to add the following.
The error occurs at the line ; .ColumnHeaders.Add , , "Profile Name",
3000, , "None"

Does the "Element" in this error refer to a db problem?
Back to top
View user's profile Send private message
Ken Halter



Joined: 04 Oct 2007
Posts: 4150

PostPosted: Tue Sep 26, 2006 3:26 pm    Post subject: Re: ListView Element not found error Reply with quote

"Greg" wrote in message @d34g2000cwd.googlegroups.com...
> Like an idiot I forgot to add the following.
> The error occurs at the line ; .ColumnHeaders.Add , , "Profile Name",
> 3000, , "None"
>
> Does the "Element" in this error refer to a db problem?

It may... but the error's not a DB related error... it's a listview content
related error.

Results 1 - 14 of 14 for "35601 Element" -dotnet -tree group:*.vb.*
http://groups.google.com.my/groups/search?hl=en&lr=lang_en&safe=off&num=100&q=%2235601+Element%22+-dotnet+-tree+group%3A*.vb.*&safe=off

....but the line below....

lvwMetricsProfiles.ListItems(llngSaveCount).ListSubItems(LV_RPT_ID).text

....looks a bit "strange" because "Text" should start with an upper case
letter. What's the deal? Did you type that in by hand? You do have Option
Explicit at the top of every module in the app, right?

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Back to top
View user's profile Send private message
Randy Birch



Joined: 04 Oct 2007
Posts: 1768

PostPosted: Tue Oct 03, 2006 1:22 am    Post subject: Re: ListView Element not found error Reply with quote

I'd say you don't have an imagelist image with the key name "None". If you
don't want to show an image in the header of a particular column, don't
assign anything to the icon parameter when adding that columnheader.
--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




"Greg" wrote in message @d34g2000cwd.googlegroups.com...
Like an idiot I forgot to add the following.
The error occurs at the line ; .ColumnHeaders.Add , , "Profile Name",
3000, , "None"

Does the "Element" in this error refer to a db problem?

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Find out if control array element has already been loaded? Hi, I need to know if a control array element has already been loaded. The following code runs but not with the expected results: For i = 0 to UpperLimit If myControl(i) Is Nothing Then Load myControl(i) Next I only want to load a new control if it has no

Update record after match is found? VB6, Access97. I get an error no value found. I'm trying to compare a list from table1.field1 to table2.field1 (PART_NUMBER) (text fields) and then if match is found then update table2.field2 (QE_NUMBER) by copying data that is is in table1.field2 (intege

how to get subitem in listview? Hello, I get a compile error ,"Invalid Qualifier", on the word SubItems in the below code. The listview is multiselect. I need to find out which items are selected and what is the third subitem of each. What's wrong with this syntax? Thanks, Rogue Petuni

SQL Error First post to this community so am not sure if this is the correct place. Here goes. I have a MS Access db that keeps track of employees sick and annual leave balances. In it, I have a report, built around a query, that lists everyone's leave balances.

where is my error in this sql? Dim sql As String Dim a As String Dim b As String a = * b = sql = "UPDATE STOCK" sql = sql & " SET AXIA_YPOL=" & a sql = sql & " WHERE CODE_STOCK=" & b sql Data1.Refresh
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group