Link to home
Start Free TrialLog in
Avatar of Marc Jacobs
Marc JacobsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Link in Sublist not applying the filter

HI,

We are using an on-click Macro instruction when clicking on a client in a sub list, within the main form, it should then apply the filter to show the results in the sub preview form but its not working.

The ApplyFilter condition is [Forms]![Dashboard]![Practice_Client_List]![ClientCode]=[Forms]![Dashboard]![Practice_Client-Preview]![ClientCode]

Any assistance would be greatly appreciated
Thanks
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Assuming ClientCode is on a Subform:

[Forms]![Dashboard]![Practice_Client-Preview].Form![ClientCode]

Also, be sure that Practice_Client-Preview is the name of your Subform CONTROL on the main form. The name of that control may or may not be the same as the form you're using as a subform.
Avatar of Marc Jacobs

ASKER

for reference the error we get is attached.
Thanks
access-error.png
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
After the above changes made the following error (attached occurs)

On the main form, the dashboard is not bound.
Thanks
error-after-change.png
Is the dashboard form open when you run this macro?

What is the *exact* spelling of the form's name as it appears in the Navigation Pane.
I am not sure I can visualize what you have there.
Can you elaborate a bit more about this interface?
< sub list>?
<sub preview form>?

As far as I can tell a simple main/subform is all that should be needed.
So selecting a Customer in the main form will automatically filter the subform for that customers Orders
(no coding or filters required)
Sample is attached.

I am sure Scot can correct your syntax and/or troubleshot the issue you are having here directly, I am just posting an alternative.

JeffCoachman
Database9.mdb
Re-ran this again and it worked, although after the 2nd attempt.


1. Compact the database
2. Compile the database - open the VBA Editor and click Debug - Compile. Fix any errors and continue doing this until the menuitem is disabled.
3. Compact again.

Sometimes it helps to Decompile the database. To do that, create a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your db" /decompile

Run that shortcut, then run the 3 steps above.