|
-
August 30th, 2001, 10:55 AM
#1
adding items tolistview
Can't figure out why this don't work. Have looked at examples and still having problem. Here's the code:
Getting error "Type Mismatch"
private Sub AddFileToListView(strFileName as string, FileDate as date)
Dim li as ListItem
set li = ListView1.ListItems.Add(, , strFileName)
With li
.SubItems(1) = strFileName
.SubItems(2) = FileDate
End With
End Sub
I get a file name listed for strFileName, however, I can't get the FileDate to be listed. Any suggestions?
-
August 30th, 2001, 11:12 AM
#2
Re: adding items tolistview
have U add columns with listview form page?
at design time, right button on listview and choose property.
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 30th, 2001, 11:13 AM
#3
Re: adding items tolistview
set view property = 3 'report
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 30th, 2001, 11:55 AM
#4
Re: adding items tolistview
Yes at design times colums are set
column 1 = File Name
column 2 = File Date
-
August 30th, 2001, 12:04 PM
#5
Re: adding items tolistview
Did not work. Now I got it to list the file name in the column "File Name" and also the file name is listed in column "File Date"
private Sub AddFileToListView(strFileName as string, FileDate as date)
Dim li as ListItem
Lv1.View = lvwReport
set li = Lv1.ListItems.Add(, , strFileName)
With li
.SubItems(1) = strFileName
.SubItems(2) = FileDate 'get error HERE NOW' "error says "Invalid property value"
End With
set li = nothing
End Sub
If I add "on error resume next" I get the file name in the column "File Date".
Any reason why?
-
August 30th, 2001, 12:17 PM
#6
Re: adding items tolistview
Found solution
set li = Lv1.ListItems.Add(, , strFileName) 'This is .SubItems(0)
With li
.SubItems(1) = FileDate
End With
set li = nothing
-
August 30th, 2001, 05:20 PM
#7
Re: adding items tolistview
yeah!
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 30th, 2001, 05:24 PM
#8
Re: adding items tolistview
U cabn access to item of lisitem for key...
so U have no link to position..
.SubItems("FileName") = strFileName
.SubItems("FileDate") = FileDate
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
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
|