Custom report title based on dialog box options

Gastrifitis

Board Regular
Joined
Sep 1, 2003
Messages
66
I have to generate reports based on an 8 week cycle for 4 different routes. I can get a dialog box, which gets the info using radio buttons, to pass this info to a query, and base a report on the query. But I need the report title to reflect the choices made in the dialog box. For example, if rte 3 and week 7 were chosen, I want the report title to say Route 3 Week 7. And so forth. What do I need to put in the report title to do this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Let's say the dialog is frmOptions, with optRoute and optWeek as the relevant controls.

The report title needs to be an unbound TextBox, with an expression referring to those controls: ="Deliveries for Route " & [Forms]![frmOptions]![optRoute] & " during week No. " & [Forms]![frmOptions]![optWeek]

Make sure that the form is not closed before opening the report, or you will get error messages. Also, change names to suit.

Denis
 
Upvote 0
Thanks! I was having trouble with the syntax, and I wouldn't have guessed anyway that the dialog box needed to stay open while that was going on. This should work great. :p
 
Upvote 0

Forum statistics

Threads
1,221,575
Messages
6,160,603
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top