I'm currently trying to print off multiple reports in MS Access database with a macro. I hope to use this macro in a form and with one click have only one print preview page show up to select a printer and print off all reports.
I've tried to set up two macros with a slight difference. I can print off all of the reports if I set the macro with the following commands;
OpenReport
(I select the report to print)
RunMenuCommand
(Selected PrintObject)
OpenReport
(I select the report to print)
RunMenuCommand
(Selected PrintObject)
Etc
Etc
Etc....
This macro will have a print preview page appear with every report I've added. I want to avoid this.
I also tried the following as well;
OpenReport
(I select the report to print)
OpenReport
(I select the report to print)
RunMenuCommand
(Selected PrintObject)
This macro only prints off the last report and not multiple reports.
As stated before I'm looking to just have the macro print off all the reports with one print preview page.
If this is or isn't possible then please let me know. Thank you.
Related
Currently SSRS Report is grouped by the following in the Row Group. When I export the report to excel it is broken into tabs by that ID. I am now passing a Parameter to the report that if set to false, the exported excel report should return only one tab. After doing a little research created an expression in the PageBreak Disabled Property. Whenever I run the report now no matter if I set the parameter to True or False it only returns a single tab. Can anyone offer any insight? THanks!
[![enter image description here][2]][2]
.Data File strikes again. Cleared cashe the expression worked.
I have a MS access report that I want to run using a linked excel table (so i cannot make any changes to the table in access).
The report has a text box which takes each row in the table and displays it in the text box and later prints it. I want to add a "*" at the beginning and end of the string and then display it in the text box.
I have done this so far:
- Choose data source (excel linked table) from report view
- In design view, press alt+F8 and drag and drop the column header I want into the report.
When I run the report it shows the report on each page, one page for every row of data which I will print later.
Now in design view after clicking on the text box, I go to property sheet and then the "Data" tab, if I try to change the expression to:
="" & [tablename].[headername] & ""
EDIT: There is an "asterisk" sign between the " " above, i don't know why they don't show.
When I run the report it asks me the parameter for the row number I want and displays the report only for that row. How can I use an expression and still be able to get all rows in the report in different pages?
Thanks!
I did what I didn't want to in order to get the problem solved. I used a query to add an additional column (using an expression) and used the query as my data source. Doesn't look like there is a good way to use the report to directly make changes to the table data and show it in a textbox.
We have a report built that accepts 5 or 6 parameters, it then produces the report as expected. What we would like to do at this point is be able to select (by check box perhaps?) specific line items in the report and submit (Submit button?) these items for a new report. I understand we could simply modify or add more parameters but for whatever reason, the "need" is to be able to select from the report results.
is this even possible?
Thanks all
The Access 2010 report i have has a text box that uses a multi-value field from a table for its control source. I know multi-value fields in tables are bad but its what i have to work with at the moment.
The problem i am having is that even though its only a two page report when i physically print it or do a print preview i get more then 2 pages. So if the multi-value field has (2) values i will get (4) pages total with the same information basically (2) copies.
How can i prevent the report from printing a copy for each value?
Ok so I will answer my own question now that i have found a work around.
I found a work around that will let me print only the pages i want (ie the first two pages or one copy not several)
In my macro instead of using RunMenuCommand PrintObject that just prints the report.
I created a vba function
Function cmdPrint()
DoCmd.PrintOut acPages, 1, 2 //acPages, start_page, end_page
End Function
and used this function from the macro using RunCode cmdPrint()
Now I only get one copy not several. Like I said its a work around but it works for me and i hope that it will help someone else someday with the same problem.
been pulling my hair out with this one. Searched everywhere and can't get anythign to work. Here's my scenario:
I have a report with several subreports from linked tables. I would like to group the subreports to sort on a given field based on the value of a variable called SORT_BY, and force a page break for each value., i.e. Group a subreport on ItemDescription or ItemLocation. The SORT_BY variable is set from a users prefs dialog. (ya, I'm using it like a constant but the user can change it)
Now, I want the user to be able to preview the report before they print. I have the report being launched in ReportView mode. This allows me to place a "Print" button and a "Close" button in the header of the report (which do not print). I have it set this way because the user is locked out of the normal "ribbon" and other controls so I have to provide buttons. The buttons do not show up in PrintPreview mode.
Obviously, I need to accomplish this via VBA. I can't seem to get GroupLevel settings to work. I've tried a CreateGroupLevel function to no avail. Tried with existing groups and with no existing groups. I've tried abandoning the group idea and simply tried to Sort the subreports using the OrderBy property, and nothing works. I'm going crazy.
Does anyone have any suggestions... other than giving up? :-)
UPDATE:
I've been trying the CreateGrouplevel function before opening the main report. i.e. open each subreport in design view, add the group, close the subform, then open the main report. However, when I try to implement the CreateGroupLevel function, I get the error:
Run-time error '2154':
You can't call this function when the Group, Sort, and Total Pane is open.
I don't understand this. Here is my code:
DoCmd.OpenReport strReport, acViewDesign
intGroupLevel = CreateGroupLevel(strReport, "FluorescentDescription", True, False)
DoCmd.Close acReport, strReport
Thoughts?
OOOPS!
Ok, so I figured out te '2154' error. Silly really, if you have EVER turned on the Group, Sort, Total Pane while editing a report, it will automatically be turned on every time you enter Design View on that report until you physically turn it off. Strange. Still chipping away at this.
I sure someone will correct me if I am wrong, however I don't think putting the buttons on the report will work. Why not build your own custom toolbar to display that contains Print and Close