Hey guys,
I have a form with a couple of ComboBoxes and one of them is being populated based on files in directories. It populates just fine but I am unable to select any value in R_Rec by clicking on it, only using arrow keys. I have found out that the line of code that's preventing me to click is highlighted in red. When I remove it I can select the values by clicking but the list just keeps populating and stacking the same values below so it seems it's needed.
Anu suggestions? Thanks
I have a form with a couple of ComboBoxes and one of them is being populated based on files in directories. It populates just fine but I am unable to select any value in R_Rec by clicking on it, only using arrow keys. I have found out that the line of code that's preventing me to click is highlighted in red. When I remove it I can select the values by clicking but the list just keeps populating and stacking the same values below so it seems it's needed.
Code:
[COLOR=#0000cd]Private Sub UserForm_Initialize()[/COLOR]
R_Country.List = Array("One", "Two", "Three")
[COLOR=#0000cd]End Sub[/COLOR]
[COLOR=#0000cd]Private Sub R_Rec_DropButton Click()[/COLOR]
Dim Rfolder, Rec As String
[B][COLOR=#ff0000]R_Rec.Clear[/COLOR][/B]
If R_Country.Value = "One" Then Rfolder = "C:\One\"
If R_Country.Value = "Two" Then Rfolder = "C:\Two\"
If R_Country.Value = "Three" Then Rfolder = "C:\Three\"
Rec = Dir(Rfolder & "*")
Do While Rec <> ""
R_Rec.AddItem Rec
Rec = Dir
Loop
[COLOR=#0000cd]End Sub[/COLOR]
Anu suggestions? Thanks
Last edited: