|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FileList in Listfield
Hello,
I'm an absolute greenhorn concerning Access... I would like to display the output of the following code in an Listfield: Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder("c:\mywordfiles") Set fc = f.Files For Each f1 In fc s = s & f1.Name s = s & vbCrLf Next Is that possible? and: when I doubleClick on an Entry the correct WordFile should open... THANKS for any help!! peter |
|
#2
|
||||
|
||||
|
I guess it's a ListBox control.
Use ListBox.AddItem method in your For...Each cycle to add the next file name to the ListBox. If you want to open the file the user double clicks, then you can retrieve the double clicked file name using ListBox.ItemsSelected and ItemData properties.
__________________
BRegs, TBÁrpi "I can only show you the door. You're the one who has to walk through it." |
|
#3
|
|||
|
|||
|
running
its working:
Me.Listbox.RowSourceType = "Value List" ' Type of source Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(SubFolderTherapie.Value) Set fc = f.Files For Each f1 In fc s = s & f1.Name s = s & ";" Next Me.Listbox.RowSource = s thanks! peter |
|
#4
|
||||
|
||||
|
Thanks for sharing this alternative solution of using RowSource.
|
|
#5
|
||||
|
||||
|
Re your private message I'm answering here 'cos others may be interested.
To retrieve the bound column of the ListBox use Value property. To retrieve any column's data use Column([index]). |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > FileList in Listfield |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|