Adding a subtitle to a report based on its query source

D

Don

I have popup form from the switchboard that allows that user to choose
a query filter to base their report on. I want to add a subtitle field
whose caption updates to the report filter on format.

However, after the report opens then the filter of the report is like
this:

(((([Timber Sales Tracking Table].PreInventoryAnswer)="Yes") AND
(([Timber Sales Tracking Table].InventoryAnswer)="No")))

I could use that as the subtitle but the user wouldn't know what it
means. I was also thinking that I could say:

If Me!.Filter = "(((([Timber Sales Tracking
Table].PreInventoryAnswer)="Yes") AND (([Timber Sales Tracking
Table].InventoryAnswer)="No")))" Then
Me![Subtitle].Caption = "Awaiting Cruise Report"

I really don't want to build a statement in the report VBA for all of
the queries though.

Any ideas?
 
G

Guest

I sometimes use a text or combo box on the form itself, let's say called
txtCaption or cmbCaption.

Then in the report, I have as the source of the Title Text Box caption:

=Forms!frmMyForm!txtCaption or =Forms!frmMyForm!cmbCaption

or it might be with a period instead of exclamation:

=Forms!frmMyForm.txtCaption or =Forms!frmMyForm.cmbCaption


The combo box on the form could pull from a table that has all your Filter
code in one Field and the corresponding Caption in the other Field.

Field1 Field2
(((timber... "Awaiting Cruise"

Then when the user chooses the Filter in the combo box, the corresponding
caption will be assigned. Perhaps you'd then need:

=Forms!frmMyForm!txtCaption.Column(1) kind of thing.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top