LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Populating Combo Boxes Still Not Working

For some reason I still cannot get the combo boxes to populate using the code
below. Does anyone have any other recommendations on how I could get this to
work? Thank you to the gentleman who helped me earlier with this but it's
still not working. Any help would be greatly appreciated !


Private Sub Populate_cboSOperations()

'Populate Combo Box cboSOperations

Dim FSO As Object
Dim sFolder As String
Dim Folder As Object
Dim file As Object
Dim Files As Object
'Dim This As Object

Set FSO = CreateObject("Scripting.FileSystemObject")
Set This = ActiveWorkbook
Folder = "C:\Ag Valley\Tracker"

If Folder < "" Then
Set sFolder = FSO.GetFolder(Folder)
Set Files = sFolder.SubFolders
cboSOperation.Clear
For Each file In Files
If file.Type = "File Folder" Then
cboSOperation.AddItem file.Name
End If
Next file
End If

Set FSO = Nothing
End Sub

Private Sub cboSOperation_Change()

'Populate Combo Box cboSGrower

Dim FSO1 As Object
Dim s1Folder As String
Dim Folder As Object
Dim file As Object
Dim Files As Object
'Dim This As Object

Set FSO1 = CreateObject("Scripting.FileSystemObject")
Set This = ActiveWorkbook
Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"

If cboSOperation.Value < "" Then
Set s1Folder = FSO1.GetFolder(Folder)
Set Files = s1Folder.SubFolders
cboSGrower.Clear
For Each file In Files
If file.Type = "File Folder" Then
cboSGrower.AddItem file.Name
End If
Next file
End If

Set FSO1 = Nothing
End Sub

Private Sub cboSGrower_Change()

'Populate Combo Box cboSYear

Dim FSO2 As Object
Dim s2Folder As String
Dim Folder As Object
Dim file As Object
Dim Files As Object
'Dim This As Object

Set FSO2 = CreateObject("Scripting.FileSystemObject")
Set This = ActiveWorkbook
Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
Trim(cboSGrower.Value) & "\"

If cboSGrower.Value < "" Then
Set s2Folder = FSO2.GetFolder(Folder)
Set Files = s2Folder.SubFolders
cboSYear.Clear
For Each file In Files
If file.Type = "File Folder" Then
cboSYear.AddItem file.Name
End If
Next file
End If

Set FSO2 = Nothing
End Sub

Private Sub cboSYear_Change()

'Populate Combo Box cboSFile

Dim FSO3 As Object
Dim s3Folder As String
Dim Folder As Object
Dim file As Object
Dim Files As Object
'Dim This As Object

Set FSO3 = CreateObject("Scripting.FileSystemObject")
Set This = ActiveWorkbook
Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"

If cboSYear.Value < "" Then
Set s3Folder = FSO3.GetFolder(Folder)
Set Files = s3Folder.SubFolders
cboSFile.Clear
For Each file In Files
If file.Type = "Microsoft Excel Worksheet" Then
cboSFile.AddItem file.Name
End If
Next file
End If

Set FSO3 = Nothing
End Sub
--
Tyrell Fickenscher
Plant Manager / Agronomist
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Populating Combo Boxes Tyrell Excel Programming 1 March 12th 06 02:38 PM
validation combo boxes not working steve alcock Excel Worksheet Functions 2 May 29th 05 06:21 PM
Populating combo boxes Cecilkumara Fernando Excel Programming 3 November 7th 03 02:38 AM
Populating Combo Boxes Tom Ogilvy Excel Programming 0 September 25th 03 04:29 AM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"