Navigation Form Subform - Reference in Macro

Holly_Associated

Registered User.
Local time
Today, 06:29
Joined
Mar 21, 2013
Messages
53
Hi All,

I have posed a similar question in the reports forum but as this now appears to be an issue with the Navigation Form I will see if any of you experts have a solution.

I am using Access 2013, I am a beginner and don't use VBA but I'm OK with normalisation, some macros and a bit of SQL.

This is the first time I've used the ApplyFilter macro...

I have a report rptAllCSCS which is based on a query qryAllCSCS.
Within the report header are 3 buttons with On Click macros.
Command79 has OpenReport... View = Print Preview macro.
Command92 has ApplyFilter... Where [Status]="Current" macro.
Command93 has RemoveFilterSort macro.

When I open the report in report view by double clicking as normal from my list of reports these buttons work fine. I can click between 92 and 93 to apply and remove my filter as many times as I wish and can see the result on screen immediately. I can then press 79 to preview and subsequently print the report.

The problem occurs when I want to add this to my Navigation Form frmMain...

Command79 still works as expected, report opens in print preview.
Command92 gives the error: The action or method is invalid because the form or report isn't bound to a table or query.
Command93 when clicked, appears to refresh but the filter isn't removed (I have it set to [Status]="Current" on load). No message box appears.

Can anyone shed any light? I have tried to make a reference to the report in the ControlName section of the ApplyFilter macro but it tells me it isn't valid. Why does this work when opening standalone but not when opening through a Navigation Form?

Argh! :banghead:

Any help appreciated!

Edit: Added an attachment example for you to play with.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom