Filter Combo box on form open event

wattsaj

New member
Local time
Today, 15:23
Joined
Jan 18, 2006
Messages
4
Can anyone help me with some apply filter code?

On clicking a button to open a form I want to filter a list in a combo Box located on the main forms subform

The main form is called 'Frm_orders'
The sub form is called 'sub' on the form but 'Fsub_OrderDetails'
The combo box field is called 'CostCodeID'
and I want to filter column 0 of the combobox which is Tbl_InvoiceCostCodes.Type to show records with a type of 'Repairs'
 
wattsaj, ultimately, we need to see the current rowsource for the combo.

Private Sub cmdOpenOrders_Click()
Docmd.openForm "Frm_Orders"
Forms!Frm_Orders!sub.Form!CostCodeID.Rowsource = _
"SELECT Repairs FROM Tbl_InvoiceCostCodes ORDER BY Repairs"
End sub
 

Users who are viewing this thread

Back
Top Bottom