I have one report with several buttons to open the report based on filters on the buttons. when button "A" is pressed, I want title of report to be "A"
when button "B" is clicked, title should be "B"
thanks
Seth,
Good solution. I always forget about that option--which has been around forever--because I haven't had a need to use it.
Clearly the easier solution in this situation. Thanks!
10 1442 - Reports![ReportName].Caption
will change the name of the report in its window, but I think you may be talking about a Title that prints on your Report?
If this is the case, the easiest way I can think of is to have the Title generated when you set the filters.
After the report is opened, use VBA to change either a Text Box or Label based on the Filters. E.g., button A is clicked, - DoCmd.OpenReport "ReportName", , , "WHERE Conditions"
-
Reports![ReportName].txtTitle = "This is Report A"
I think that should help. Let us know if you run across other snags.
thank you for your responce
this is my code -
DoCmd.OpenReport "RptUnion", acViewPreview, , "Check=-1"
-
Reports![RptUnion].Title5 = "This is Report A"
title5 is an unbound textbox
there is no error message in the code but the text box is empty
thank you
dovid
That was unexpected--although I had not tried that before. based on how Access uses all other Objects, one could only assume the same would work for reports......
Is there a way you could establish a Global Variable using TempVars()? This could hold a value, then the Control Source for that Text box could be the value of the Variable.
Your Code to open the report would be: - Dim strReportName As String
-
strReportName = "This is Report A"
-
TempVars.Add "ReportName", strReportName
-
DoCmd.OpenReport "RptUnion", acViewPreview
Then, the Control Source for the Text box is:
Hope this hepps!
Instead of using a Tempvar, I would just add an OpenArgs to the DoCmd.OpenReport command and then use the report's OnLoad event to set the value of Title5 to the value in the OpenArgs property. - DoCmd.OpenReport "RptUnion", acViewPreview, , "Check = -1", , "This is Report A"
Then in the report's OnLoad event,
Seth,
Good solution. I always forget about that option--which has been around forever--because I haven't had a need to use it.
Clearly the easier solution in this situation. Thanks!
perfect, thanks for everything
dovid
I would suggest selecting Post #5 as the answer for this thread....
Your call to open the report would be: - DoCmd.OpenReport "RptUnion", acViewPreview, , "Check = -1", , 1 'or 2 or 3
The title is set in the OnOpen event as well.
took me a bit to get it to work but it's perfect
learned a lot of new options
thanks for everything
dovid
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Patrick |
last post by:
i have the following .aspx file defined:
..... other tags here ...
<asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell>
..... other tags...
|
by: fleece |
last post by:
I have a continuous form based on some selected criteria. Now I want to send the search results to a report. How could I do that? It's better if I could sort the results before export to report. ...
|
by: favor08 |
last post by:
have a mainform called PendingsMain and a subform called
PendingsSub. You can filter the subform by different filters and this
works fine.
i want to create a report that will print out the...
|
by: Apple001 |
last post by:
I am having hard time finding the way to make the database below.
I have:
-Form "frmInvoice" with subform "Allocation" based on table "tblInvoice" and "tblAllocation". "invID" is auto number in...
|
by: rkm2 |
last post by:
I currently have a form "UserSearchForm" which allows a user to select values from several different unbound combo boxes in the header section and press a search command which filters the list in the...
|
by: darnnnel |
last post by:
Hi everyone! I’m not sure how to even begin. I have a form and a subform and they are not linked. I would like to have a button on the form that would only change the data in the subform,...
|
by: QCLee |
last post by:
Hello Sir, Im here again asking for help. I have a form and a subform relate to HVAC Windward Table. i have a SAVE button on the form that when clicked it saves data on the HVAC Windward Table but...
|
by: Steve |
last post by:
I am working on a database that has a main menu, many sub-menus and some
sub-sub-menus. They are all forms that have numerous command buttons on them
to open forms and reports in the database. The...
|
by: John Lewis |
last post by:
I have created a windows form application using an Access 2003 db. I used the drag and drop methods to place the fields on the forms and the same with the second form using the related table from the...
|
by: beacon |
last post by:
Hi everybody,
I have a main form, frmDeficiency, that has a tab control, deficiencyTabControl, that has a subform, fsubEpisodeDetail, on page 2 of the tab control. I also have a command button...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |