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 1434 - 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: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |