I've spent so much time on this, and now I am almost there. Any help would be much appreicated.
I have a form in which I select a category of work from ComboBox "WorkTypeMain". Now I want to filter out all types of work under this category from table "z_ProposalDetailList". In this table, column "Details" has the details I want to filter and pick in ComboBox2. Column "WorkType" from this table is a Number which is a lookup to another table that lists the category of work. This table is what I select from the first ComboBox.
Anyways, everything is working great when I go to "Test1" ComboBox from the main form. However, I want this to work in the subform. When I select the Drop Down in the Subform, it asks me to "Enter Parameter" of what "WorkTypeMain" is. Once I type the number that matches the ID Key of the table, it then lists the right information. I'm sure it is something very stupd and simple with the last line of code. Please help.
Main Form name is "Proposals"
Subform Name is "z_ProposalDetailsSubform"
DropDown Box in subform label is "ProposalDetails"
Dim strSQL As String
strSQL = "SELECT [Details] " _
& "FROM [z_ProposalDetailList] " _
& "WHERE WorkType =WorkTypeMain"
Me.Test1.RowSource = strSQL
Me.z_ProposalDetailsSubform!ProposalDetails.RowSource = strSQL
I have a form in which I select a category of work from ComboBox "WorkTypeMain". Now I want to filter out all types of work under this category from table "z_ProposalDetailList". In this table, column "Details" has the details I want to filter and pick in ComboBox2. Column "WorkType" from this table is a Number which is a lookup to another table that lists the category of work. This table is what I select from the first ComboBox.
Anyways, everything is working great when I go to "Test1" ComboBox from the main form. However, I want this to work in the subform. When I select the Drop Down in the Subform, it asks me to "Enter Parameter" of what "WorkTypeMain" is. Once I type the number that matches the ID Key of the table, it then lists the right information. I'm sure it is something very stupd and simple with the last line of code. Please help.
Main Form name is "Proposals"
Subform Name is "z_ProposalDetailsSubform"
DropDown Box in subform label is "ProposalDetails"
Dim strSQL As String
strSQL = "SELECT [Details] " _
& "FROM [z_ProposalDetailList] " _
& "WHERE WorkType =WorkTypeMain"
Me.Test1.RowSource = strSQL
Me.z_ProposalDetailsSubform!ProposalDetails.RowSource = strSQL