Minggu, 30 Juli 2017

[MS_AccessPros] Populate list box via a combo box

 

I was looking at the samples on the site but could not find what I am looking for. I have a series of combo boxes and a list box set up as follows which are related, they populate the combo below them.:


cboCabinets:

RowSource:

SELECT tblCabinet.intCabinetID, tblCabinet.txtCabinetName, tblCabinet.txtCabinetLocation FROM tblCabinet;

After_Update:  

Dim sDrawerLoadSource As String
   
    sDrawerLoadSource = "SELECT [tblDrawer].[intDrawerID], [tblDrawer].[intCabinetID], [tblDrawer].[txtDrawerName] " & _
                        "FROM tblDrawer " & _
                        "WHERE [intCabinetID] = " & Me.cboCabinet.Value
    Me.cboDrawer.RowSource = sDrawerLoadSource
    Me.cboDrawer.Requery


cboDrawer:

RowSource:SELECT tblDrawer.intDrawerID, tblDrawer.intCabinetID, tblDrawer.txtDrawerName, tblDrawer.txtDrawerLocation FROM tblDrawer;

After_Update:

Dim sPriFoldersLoadSource As String
   
    sPriFoldersLoadSource = "SELECT [tblPrimaryFolder].[intPriFolderID], [tblPrimaryFolder].[intDrawerID], [tblPrimaryFolder].[txtPriFolderName] " & _
                        "FROM tblPrimaryFolder " & _
                        "WHERE [intDrawerID] = " & Me.cboDrawer.Value
    Me.cboPriFolders.RowSource = sPriFoldersLoadSource
    Me.cboPriFolders.Requery


cboPriFolders

RowSource:SELECT tblPrimaryFolder.intPriFolderID, tblPrimaryFolder.intDrawerID, tblPrimaryFolder.txtPriFolderName, tblPrimaryFolder.txtPriFolderLocation FROM tblPrimaryFolder;


After_Update


This were I get lost. I am not sure how to write the connection code for the list box:


lstSubfolders

RpwSource: SELECT tblSubFolder.intSubFolderID, tblSubFolder.txtSubFolderName, tblSubFolder.intPriFolderID FROM tblSubFolder;


Now a Primary folder can have several subfolders which can be loaded into the list box. Hope youcan help.


Thank you


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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar