ascendantP
New member
- Local time
- Yesterday, 22:14
- Joined
- Nov 20, 2013
- Messages
- 8
Hi All,
I have a form that also has a subform. Table tblIdeaScaleME is the parent table that populates data on the form. Table tblDecisions is the child table that is linked to the subform for user entry purposes. Both tables are linked by a primary key, Idea Number. What I would like is to filter out choices in the combobox that has data already in the Moderator Decision field from the child table. For example, if table tblIdeaScaleME has 4 ideas and table tblDecisions has a decision for idea 3 in the Moderator Decision field, then I would like a command button to contain the functionality to requery the combobox to only contain the choices of ideas 1, 2, and 4 since idea 3 already contains information.
This is currently my code for the command button.
I should note that this is a cascading combobox so cboSearchSponsor is the first combobox that requeries cboIdeaNum to populate information. Right now, when I execute this, there are no choices in my combobox. Hopefully someone point me in the right direction.
Thanks
I have a form that also has a subform. Table tblIdeaScaleME is the parent table that populates data on the form. Table tblDecisions is the child table that is linked to the subform for user entry purposes. Both tables are linked by a primary key, Idea Number. What I would like is to filter out choices in the combobox that has data already in the Moderator Decision field from the child table. For example, if table tblIdeaScaleME has 4 ideas and table tblDecisions has a decision for idea 3 in the Moderator Decision field, then I would like a command button to contain the functionality to requery the combobox to only contain the choices of ideas 1, 2, and 4 since idea 3 already contains information.
This is currently my code for the command button.
Code:
Dim sSQL As String
sSQL = "SELECT tblIdeaScaleME.[Idea Number], tblIdeaScaleME.Title, tblIdeaScaleME.Campaign" & _
" FROM tblDecisions INNER JOIN tblIdeaScaleME ON tblDecisions.[Idea Number] = tblIdeaScaleME.[Idea Number]" & _
" WHERE (((tblIdeaScaleME.Campaign) = [Forms]![frmManagementEvaluation]![cboSearchSponsor]) AND ((tblDecisions.[Moderator Decision])=""))" & _
" ORDER BY tblIdeaScaleME.[Date] ASC"
cboIdeaNum.RowSource = sSQL
Me.cboIdeaNum = Me.cboIdeaNum.ItemData(0)
I should note that this is a cascading combobox so cboSearchSponsor is the first combobox that requeries cboIdeaNum to populate information. Right now, when I execute this, there are no choices in my combobox. Hopefully someone point me in the right direction.
Thanks