I have a form and a subform. After updating one of the cboBox in the main form [Supplier] I would like the cboBox [Products] in the subform to filter out only the products from the supplier selected above. Currently the subform picks all the products from all suppliers.
Forms AfterUpdate
Collapse
X
-
and your data base is in SQL? excel? access?? or is it a list you have in a combo or a listbox?Originally posted by IqbalEvaI have a form and a subform. After updating one of the cboBox in the main form [Supplier] I would like the cboBox [Products] in the subform to filter out only the products from the supplier selected above. Currently the subform picks all the products from all suppliers. -
Updating Forms by Filter
I have a similar question.
In the "Filter part" of the form, combo boxes populate the data for YearFilter and Cat(egory)Filte r. The default values are preload and the filter works "On Load", but I can't get the data to refresh in the sub-form.. I also tried requery
The "AfterUpdat e" of the ComboBox, I have
Private Sub cboYearFilter_A fterUpdate()
[Forms]![frmMainMenu]![txtCorpPgmYear] = cboYearFilter
Call ApplyCorpFilter s
End Sub
-----------------------------
Private Sub Form_Load()
Call ApplyCorpFilter s
Me.Refresh
End Sub
---------------------------------
Private Sub ApplyCorpFilter s()
Me.AllowFilters = True
YearFilter = [Forms]![frmMainMenu]![txtCorpPgmYear]
CatFilter = [Forms]![frmMainMenu]![txtCorpCategory Filter]
If CatFilter <> "(All)" Then
strFilter = "([Year] = '" & YearFilter & "' AND [Category] = '" & CatFilter & "')"
Else
strFilter = "[Year] = '" & YearFilter & "'"
End If
Me.RecordSource = "SELECT CorpPrograms.* FROM CorpPrograms WHERE " & strFilter & " ORDER BY CorpPrograms.Co rpProgram"
Me.Refresh
End SubComment
Comment