I'm working on Access Tracker, basically it has a table and form. The column headers of table are parent entity, subs, Compliance etc., the combo boxes in form are parententity2, subs2, compliance2, etc. Each parent in the table can have multiple subs. I have written a code in such a way when I select a value in the form of parententity2, then it autopopulates the rest of the information. However, when a parent has multiple subs it is not showing all of the values, instead it is showing the first value which is in the list. For example ABC is a parent company and A1, B1, C1, are subs..then output is when I filter ABC then under subs dropdown I can only see A1, instead of A1, B1, C1
Private Sub Subs2_AfterUpdate()
Dim strFilter As String
Dim abc
' Get the selected value from the parententity2 combo box
'Dim strFilter As String
strFilter = Me.Parententity2.Value
' Apply the filter to the form's record source
Me.RecordSource = "SELECT * FROM [Data] WHERE [parent entity] = '" & strFilter & "'"
' Populate the Subs column with the filtered data
Me.Subs2.RowSource = "SELECT DISTINCT [subs] FROM [Data] WHERE [parent entity] = '" & strFilter & "'"
End sub