Let me see if I understand correctly.
The master form is named "frmInput" ; the record source is table "tblContractor" (or a query based on tblContractor)
The sub-form is named "frmSubform"; the record source is table "tblDetails" (or a query based on tblDetails)
The main form and sub form are linked by the "Link Master field" and the "Link Child Fields".
So the "
Link Master field" is the PK field of the table "tblContractor" and the "
Link Child Fields" is the FK field in table "tblDetails".
When you select a record in the main form, the sub form changes records. Good so far?
Now you want to use a list box to filter the main form.
You have
Code:
X = Me.List29.Column(0)
Me.FilterOn = True
Me.Filter = "tblContractor.ID =" & X
You
cannot set the filter
on, then set the filter expression.
The code behind the list box should be:
Code:
Private Sub List29_Click()
Me.Filter = "ID =" & Me.List29
Me.FilterOn = True
End Sub
That is all it takes......
IF I understood correctly.
(You should take the time to rename the objects. "List29" is a poor name as is "ID" for a field name)
You should also have a button to remove the main form filter.
Code:
Private Sub btnRemoveFilter_Click()
Me.Filter = "" '<<-- not really needed, but I like to keep it clean
Me.FilterOn = False
End Sub