ChrisLeicester
Member
- Local time
- Today, 11:46
- Joined
- Feb 14, 2025
- Messages
- 33
Hi All
I have an unbound form with a subform in it in continuous form layout.
The subform lists a query with all products along with the product category. In the subform header area I have a combi box which lists each category, the idea being the user can select a category and the continous records filter to that category.
I am trying to use the after update event to run the following;
PetTypeID is the primary key for the category and is a number.
CustSaleProductSelectFM is the subform name and control name on the form.
When the event runs, I get a compile error - "Method or data member not found" and the me.CustSaleProductSelectFM.filter=strSQL line is highlighted yellow in the debugger.
Strangely, on a separate from I have similar code filtering customers by postcode or surname triggered by a command button and it works great.
What am I doing wrong.
Thanks in advance
I have an unbound form with a subform in it in continuous form layout.
The subform lists a query with all products along with the product category. In the subform header area I have a combi box which lists each category, the idea being the user can select a category and the continous records filter to that category.
I am trying to use the after update event to run the following;
Code:
Private Sub PetFilter_AfterUpdate()
Dim strSQL As String
strSQL = "PetTypeID = " & Me.PetFilter
Me.CustSaleProductSelectFM.Form.Filter = strSQL
Me.CustSaleProductSelectFM.Form.FilterOn = True
End Sub
PetTypeID is the primary key for the category and is a number.
CustSaleProductSelectFM is the subform name and control name on the form.
When the event runs, I get a compile error - "Method or data member not found" and the me.CustSaleProductSelectFM.filter=strSQL line is highlighted yellow in the debugger.
Strangely, on a separate from I have similar code filtering customers by postcode or surname triggered by a command button and it works great.
What am I doing wrong.
Thanks in advance