If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Printing immediately from form
I'm going to start this off for apologizing for not being able to find the
answer to this already on the forums as well as not being able to figure it out since it seems it should be easy. Here's the background: I've got a form with some information on it. I've got a query to pull up all sorts of related information to what I'm looking at in the form as well as the information in the form (one result in query). I've got multiple reports in which to print out this information on to an assortment of labels (the information is different as some items are shipped out and we keep the backups/related items). All of this is getting printed out on a continuous feed label printer, the individual labels are already separated on the roll of paper labels. I've treated each "page" of the report as one label. Each report consists of 1 page. The problem: Not only do I want to be able to print a report without having having to deal with the query or report in any way (i.e. click on the button, query opens, report prints) but I want to print out a specific number of copies of one of my one page reports. "Specific number" happens to refer to a quantity that has been produced and needs labeled and this number is fetched by the query. What I'd like the play by play to be: I click button. Query opens, report #1 prints "n" number of copies. Report #1 closes. Report #2 opens. Report #2 prints "x" number of copies ("x" is preset/static). Report #2 closes. Report #3 opens. Report #3 prints one copy. Report #3 closes. Query closes. Nothing of the above is apparent to the user except the new pile of labels he/she has to now deal with. Can I write all of this to happen with a single on_click event? Hopefully the over-explanation helps and thanks in advance. -Jon |
#2
|
|||
|
|||
Hi Jon. There are several aspects to your question.
You can print multiple different reports with one click. In the Click event of your button, just perform an OpenReport for each: DoCmd.OpenReport "Report1" DoCmd.OpenReport "Report2" ... That prints the reports directly: no preview, no queries open on screen. If you wish to filter them to just oa particular record, use the WhereCondition of the OpenReport action. This example prints just the record where PackingID is the same as the PackingID number in the form: Dim strWhere As String strWhere = "[PackingID] = " & Me.PackingID DoCmd.OpenReport "Report1", acViewNormal, , strWhere DoCmd.OpenReport "Report2", acViewNormal, , strWhere ... Since you want to print multiple copies of one label, see: Printing a Quantity of a Label at: http://members.iinet.net.au/~allenbrowne/ser-39.html The article explains how to use a Cartesian Product query to generate a record for each label to be printed, including the "3 of 4" on the label. So, yes: you can click a button, and it all "just happens" as far as the user is concerned. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Jon L." wrote in message ... I'm going to start this off for apologizing for not being able to find the answer to this already on the forums as well as not being able to figure it out since it seems it should be easy. Here's the background: I've got a form with some information on it. I've got a query to pull up all sorts of related information to what I'm looking at in the form as well as the information in the form (one result in query). I've got multiple reports in which to print out this information on to an assortment of labels (the information is different as some items are shipped out and we keep the backups/related items). All of this is getting printed out on a continuous feed label printer, the individual labels are already separated on the roll of paper labels. I've treated each "page" of the report as one label. Each report consists of 1 page. The problem: Not only do I want to be able to print a report without having having to deal with the query or report in any way (i.e. click on the button, query opens, report prints) but I want to print out a specific number of copies of one of my one page reports. "Specific number" happens to refer to a quantity that has been produced and needs labeled and this number is fetched by the query. What I'd like the play by play to be: I click button. Query opens, report #1 prints "n" number of copies. Report #1 closes. Report #2 opens. Report #2 prints "x" number of copies ("x" is preset/static). Report #2 closes. Report #3 opens. Report #3 prints one copy. Report #3 closes. Query closes. Nothing of the above is apparent to the user except the new pile of labels he/she has to now deal with. Can I write all of this to happen with a single on_click event? Hopefully the over-explanation helps and thanks in advance. -Jon |
#3
|
|||
|
|||
Awesome. I need to make sure that I can have the report pull some of the
information that's not on the form (but comes from elsewhere) that's related. So while strWhere = "[PackingID] = " & Me.PackingID will work, I also have a client name from a client table. I'm sure it will work, I just need to retool just about ALL of my reports. Good in the long run, not for the work in the short run. Your tips from the website are very helpful. And I don't even need to make any labels like "3 out of 4". Thanks again! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Default values to load up automatically in a form based on value entered in another form | Anthony Dowd | Using Forms | 8 | August 12th, 2004 08:53 AM |
synchronizing form and list box | Deb Smith | Using Forms | 8 | June 21st, 2004 08:15 PM |
surely a form with a ListBox can be used in a query? | 1.156 | Running & Setting Up Queries | 14 | June 2nd, 2004 04:54 PM |
use data entered in unbound controls (on a form) when printing a report | Karen | New Users | 1 | May 25th, 2004 08:17 PM |
Form Doesn't Go To New Record | Steve | New Users | 15 | May 16th, 2004 04:33 PM |