I have three combos boxes, which should populate the next automatiacally. The first one is cboCabinet:
Private Sub cboCabinet_AfterUpdate()
Dim sFolderLoadSource As String
sFolderLoadSource = "SELECT [tblFolders].[FolderID], [tblFolders].[CabinetID], [tblFolders].[FolderName] " & _
"FROM tblFolders " & _
"WHERE [CabinetID] = " & Me.cboCabinet.Value
Me.cboFolders.RowSource = sFolderLoadSource
Me.cboFolders.Requery
Me.sfrmIndexes.Form.Requery
End Sub
This Works to populate the second combo called cboFolders.
Private Sub cboFolders_AfterUpdate()
Dim sFolderSource As String
sFolderSource = "SELECT [tblSubFolders].[SUbFolderID], [tblSubFolder].[FolderID], [tblSubFolder].[SubFolderName] " & _
"FROM tblSubFolders " & _
"WHERE [FolderID] = " & Me.cboFolders.Value
Me.cboSubFolders.RowSource = sFolderSource
If sFolderSource = "" Then
Me.cboSubFolders.Value = "No Sub Folders"
Else
Me.cboSubFolders.Requery
End If
End Sub
My issues when it tries to populate the 3rd combo called cboSubFolders, there might be cases where there is no records in the subfolder table for a given combination of the first two combos. I am trying to set the value of cboSubFolders to No SubFolders in case of this combination. But it is not working. Any ideas?
Signed,
Art Lorenzini
Sioux Falls, SD
Posted by: dbalorenzini@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar