I have two databases, one with products and another with accessories and a query which relates products and accessories. I created a simple report which lists the product fields and has two subforms. The first subform simply lists all the accessories. The second subform needs to list a subset of accessories so I wrote a few lines in VBA which is called on the LOAD control. The VBA simply gets some criteria from another table, makes some decisions and sets a filter to limit accessories by a date:
The problem is that the subform works fine when you load it from the interface. However, in the report the filter never gets applied and the form simply displays the same as the first subform, ie all the accessories are shown. The subform when displayed as part of a report does not call the VBA code. How can I get around this?
Many thanks!
Code:
Me.Filter = "([OldNew] > " & Format(Min_yr, strcJetDate) & ") AND ([Nacido] <= " & Format(Max_yr, strcJetDate) & ")" Me.FilterOn = True
Many thanks!
Comment