rhxiong
05-08-2007, 01:55 PM
I used this code from JimmyTheHand to list the files in a directory in my combo box.
VBA:
Sub FileList_to_ComboBox(Fldr As String)
Dim sTemp As String
sTemp = Dir(Fldr & "*.*", vbNormal)
Do
If sTemp <> "." And sTemp <> ".." Then
Forms("Form1").Controls("ComboBox1").AddItem sTemp
End If
sTemp = Dir()
Loop Until sTemp = ""
End Sub
---
Now I need to make it so that once I select the item from the combo box, it doesn't show up anymore. I use this box multiple times and if the same files I had selected shows up in the combo box again, I may select the same ones again.
Help??
VBA:
Sub FileList_to_ComboBox(Fldr As String)
Dim sTemp As String
sTemp = Dir(Fldr & "*.*", vbNormal)
Do
If sTemp <> "." And sTemp <> ".." Then
Forms("Form1").Controls("ComboBox1").AddItem sTemp
End If
sTemp = Dir()
Loop Until sTemp = ""
End Sub
---
Now I need to make it so that once I select the item from the combo box, it doesn't show up anymore. I use this box multiple times and if the same files I had selected shows up in the combo box again, I may select the same ones again.
Help??