I have been struggling to identify the source of this problem for the past few days. My Internet searches for what's causing this issue have not been fruitful.
This is a program uses Access as the front end UI for user to enter client information into the database hosted on SQL Server.
The interaction should be as follows:
- User click on client list in main form
- A list of accounts is displayed in main form
- User click on an account
- List of products is displayed in a tabular subform (for update/add new product)
- User select one of the products
- Corresponding monthly product values are displayed on another subform (not under the products list subform)
When the main form is initially loaded, the monthly product values filter value is 0 by default. The filter should be updated dynamically when one of the products is selected. It was done under the Form_Current event for the products form.
What I can't figure out is: The filter seems to stuck at the default state. I used the Debug.Print statement to check the latest filter value for the monthly product values form and it shows the correct product ID for the filter. But it's not updated on the UI at all.
What's even weirder is: it works (i.e. monthly values are listed) sometime when I made changes to the vba code (that sometimes not related to filter) and save it when it's in Application mode e.g:
.filter = "prod_id = " & iProdID
to
.filter = "[prod_id] = " & iProdID
But then when I change it to Design mode and start making changes not related to this issue, it stopped working when it's in Application mode again. The behavior is so unpredictable that I am not sure how to proceed. I even remove the form and recreate it again and it's still behaving similarly.
I am using the same way to work on the filer in VBA for the other subforms and they are behaving correctly. Hope to get some feedback on what I overlooked!
Thanks! Kiat
order by
orfilter
property that shouldn't be there. Also try adding aform.refresh
orform.requery
after the filter is applied. – Scotch