Select from Listbox in Access 2007

I load my listbox with the following code:
Private Sub Form_Load()
Dim fso As New IWshRuntimeLibrary.FileSystemObject
Dim fld As Folder
Dim fil As File
Me.lstFiles.RowSource = ""
Set fld = fso.GetFolder(gstrMediaFolder)
For Each fil In fld.Files
    Me.lstFiles.AddItem fil.Name
Next fil
End Sub

The listbox is filled with the names of the files in the folder but I cannot select an item and listindex appears to be stuck at -1
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have you set the RowSourceType property to a Value List?
Cheers, Andrew
jking1234Author Commented:
Yes that has been done
Jeffrey CoachmanMIS LiasonCommented:

Yeah, the same thing happens to comboboxes when any of these is true:
The form is being opened in Read Only mode (No edits allowed)
The Forms "Allow Edits" Property set to: No
The Listbox's "Locked" Property is set to: Yes

Check these as well


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
Which was it?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.