PDA

View Full Version : [SOLVED:] Combobox source worked in Windows 7, not in Windows 8



Johann
10-07-2015, 05:24 AM
I have an Access file that has a combobox populated by a few Excel files that are stored in a folder. The list used to be populated fine and worked perfectly in Windows 7 with Office 2007 but now in Windows 8 and Office 2007 it doesn't. In stead of creating the drop down list, I now have all the options listed side by side.



Set f = fs.GetFolder("C:\Program Data\SVDM-2011\Templates\Primary Entries")
Set fc = f.Files
Teller = 0 'counter used to move through all the files in the folder
RySource = "" 'rowsource is first set to nothing
For Each f1 In fc
Teller = Teller + 1
If Right(f1.Name, 4) = "xlsm" Then 'only include valid files
If Teller > 1 Then
RySource = RySource & ", " & Left(f1.Name, InStr(f1.Name, ".") - 1)
Else
RySource = Left(f1.Name, InStr(f1.Name, ".") - 1)
End If
End If
Next
Me.cPrimaryEntries.RowSource = RySource


Many thanks!!

Johann

Johann
10-07-2015, 05:38 AM
I solved the issue! :-)

It seems that in Windows the items are seperated by semi-colons ";" rather than comma's ",". So simple!


RySource = RySource & ", " & Left(f1.Name, InStr(f1.Name, ".") - 1)

becomes


RySource = RySource & "; " & Left(f1.Name, InStr(f1.Name, ".") - 1)