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
|
|||
|
|||
creating a label report in access
What I'm looking for is two things actually. I need to know the coding I
should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? |
#2
|
|||
|
|||
On Mon, 21 Feb 2005 06:41:04 -0800, Melissa wrote:
What I'm looking for is two things actually. I need to know the coding I should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? First make sure your label report is properly printing a full sheet of labels. Then add a Report Header to your label report. Add 2 text boxes to the Header. 1) Name one SkipControl Leave it's control source unbound 2) Name the other SkipCounter Set it control Source to =[Skip How Many?] Now code the Report Header Format event as below: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ========== Next code the Detail OnPrint event: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub ===== When you are ready to run the label report, it will ask how many to skip. Then it will run the report. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
Thanks Fred, that worked for skipping labels...any suggestions on printing
duplicate same page labels?? "fredg" wrote: On Mon, 21 Feb 2005 06:41:04 -0800, Melissa wrote: What I'm looking for is two things actually. I need to know the coding I should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? First make sure your label report is properly printing a full sheet of labels. Then add a Report Header to your label report. Add 2 text boxes to the Header. 1) Name one SkipControl Leave it's control source unbound 2) Name the other SkipCounter Set it control Source to =[Skip How Many?] Now code the Report Header Format event as below: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ========== Next code the Detail OnPrint event: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub ===== When you are ready to run the label report, it will ask how many to skip. Then it will run the report. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#4
|
|||
|
|||
On Tue, 22 Feb 2005 06:27:02 -0800, Melissa wrote:
Thanks Fred, that worked for skipping labels...any suggestions on printing duplicate same page labels?? "fredg" wrote: *** snipped *** There are several different methods. Here is one that combines the skip missing labels with repeating them. This will permit you to enter the number of times to repeat the labels, as well as skip missing label positions on an already used sheet. First make sure your label report properly prints 1 label per record. Then add a Report Header to the label report. Add 3 unbound text boxes to the header. 1) Set the Control Source to: = [Skip how many] Name this control SkipCounter 2) Leave the second control unbound. Name this control SkipControl 3) Set the third control's Control Source to: =[Repeat how many] Name it RepeatCounter Next code the Report Header OnFormat event: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ======= Now code the Detail OnPrint Event: (Note that intMyPrint is Static!!) Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) Static intMyPrint As Integer If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False intMyPrint = 0 Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True intMyPrint = intMyPrint + 1 If IsNull([RepeatCounter]) Then ElseIf intMyPrint Mod [RepeatCounter] = 0 Then Me.NextRecord = True intMyPrint = 0 Else Me.NextRecord = False End If End If End Sub ========= When you run the report, it will ask how many labels to skip, then how many times to repeat each label. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#5
|
|||
|
|||
creating a label report in access
"fredg" wrote: On Mon, 21 Feb 2005 06:41:04 -0800, Melissa wrote: What I'm looking for is two things actually. I need to know the coding I should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? First make sure your label report is properly printing a full sheet of labels. Then add a Report Header to your label report. Add 2 text boxes to the Header. 1) Name one SkipControl Leave it's control source unbound 2) Name the other SkipCounter Set it control Source to =[Skip How Many?] Now code the Report Header Format event as below: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ========== Next code the Detail OnPrint event: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub ===== When you are ready to run the label report, it will ask how many to skip. Then it will run the report. -- Fred Please only reply to this newsgroup. I do not reply to personal email. Hi Fred, I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance |
#6
|
|||
|
|||
creating a label report in access
On Thu, 28 Aug 2008 14:39:01 -0700, jinh wrote:
"fredg" wrote: On Mon, 21 Feb 2005 06:41:04 -0800, Melissa wrote: What I'm looking for is two things actually. I need to know the coding I should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? First make sure your label report is properly printing a full sheet of labels. Then add a Report Header to your label report. Add 2 text boxes to the Header. 1) Name one SkipControl Leave it's control source unbound 2) Name the other SkipCounter Set it control Source to =[Skip How Many?] Now code the Report Header Format event as below: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ========== Next code the Detail OnPrint event: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub ===== When you are ready to run the label report, it will ask how many to skip. Then it will run the report. -- Fred Please only reply to this newsgroup. I do not reply to personal email. Hi Fred, I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance Sorry, I'm here and you're there, and I can't see your report. The above code works to skip missing label positions on a label sheet. I use it all the time. What does your report do? Does it not skip positions at all? Does it skip more positions than you entered? Did you add the controls to the Report Header? Did you name those controls "SkipCounter" and "SkipControl"? Do you get prompted for the number of labels to skip when you run the report? Does the report work properly otherwise? I would suggest you copy and paste into a reply message "your exact" code, including the Private Sub ... etc.. lines. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#7
|
|||
|
|||
creating a label report in access
"fredg" wrote: On Thu, 28 Aug 2008 14:39:01 -0700, jinh wrote: "fredg" wrote: On Mon, 21 Feb 2005 06:41:04 -0800, Melissa wrote: What I'm looking for is two things actually. I need to know the coding I should use in order to create duplicate, same page labels and also how to skip printing on certain labels. These are two seperate label reports. The one report is for file folder labels and I do not print the whole page at one time. I may print two labels the first time so the second time I would want it to start printing on the third label. Any suggestions?? First make sure your label report is properly printing a full sheet of labels. Then add a Report Header to your label report. Add 2 text boxes to the Header. 1) Name one SkipControl Leave it's control source unbound 2) Name the other SkipCounter Set it control Source to =[Skip How Many?] Now code the Report Header Format event as below: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [SkipControl] = "Skip" Cancel = True End Sub ========== Next code the Detail OnPrint event: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [SkipCounter] And [SkipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [SkipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub ===== When you are ready to run the label report, it will ask how many to skip. Then it will run the report. -- Fred Please only reply to this newsgroup. I do not reply to personal email. Hi Fred, I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance Sorry, I'm here and you're there, and I can't see your report. The above code works to skip missing label positions on a label sheet. I use it all the time. What does your report do? Does it not skip positions at all? Does it skip more positions than you entered? Did you add the controls to the Report Header? Did you name those controls "SkipCounter" and "SkipControl"? Do you get prompted for the number of labels to skip when you run the report? Does the report work properly otherwise? I would suggest you copy and paste into a reply message "your exact" code, including the Private Sub ... etc.. lines. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Sorry Fred, First, I like to thank you for you quick respond. That's really nice of you. Anyway, I tried both copying your codes over & I've tried to type in by myself. What it is doing is when I run the report, it'll ask for skip how many. I typed in 1 & the report just print at the 0 position. Here is the code: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [skipCounter] And [skipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [skipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [skipControl] = "Skip" Cancel = True End Sub |
#8
|
|||
|
|||
creating a label report in access
*** snipped ***
I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance Sorry, I'm here and you're there, and I can't see your report. The above code works to skip missing label positions on a label sheet. I use it all the time. What does your report do? Does it not skip positions at all? Does it skip more positions than you entered? Did you add the controls to the Report Header? Did you name those controls "SkipCounter" and "SkipControl"? Do you get prompted for the number of labels to skip when you run the report? Does the report work properly otherwise? I would suggest you copy and paste into a reply message "your exact" code, including the Private Sub ... etc.. lines. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Sorry Fred, First, I like to thank you for you quick respond. That's really nice of you. Anyway, I tried both copying your codes over & I've tried to type in by myself. What it is doing is when I run the report, it'll ask for skip how many. I typed in 1 & the report just print at the 0 position. Here is the code: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [skipCounter] And [skipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [skipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [skipControl] = "Skip" Cancel = True End Sub I just copied and pasted this code, exactly as you sent it to me, into a label report. It works just fine. I'll have to re-iterate my question to you from the previous post... Did you add the 2 controls to the REPORT HEADER? Did you name those controls "SkipCounter" and "SkipControl"? Did you leave the Control Source of [SkipControl] blank? Now I'll add.. What happens if you enter 5 to skip instead of 1? Check Report Header Format and the Detail Print event lines (on the property sheet). Does that line on the property sheet say [Event Procedure]? It should. *** After thinking about it, I think this is the most likely problem. Did you try setting a breakpoint in the code, stepping through the code one line at a time, to read the values of SkipCounter and [SkipControl] to see what those values are as the report is running? In any event, the code is fine so it must be something else you have or have not done. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#9
|
|||
|
|||
creating a label report in access
"fredg" wrote: *** snipped *** I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance Sorry, I'm here and you're there, and I can't see your report. The above code works to skip missing label positions on a label sheet. I use it all the time. What does your report do? Does it not skip positions at all? Does it skip more positions than you entered? Did you add the controls to the Report Header? Did you name those controls "SkipCounter" and "SkipControl"? Do you get prompted for the number of labels to skip when you run the report? Does the report work properly otherwise? I would suggest you copy and paste into a reply message "your exact" code, including the Private Sub ... etc.. lines. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Sorry Fred, First, I like to thank you for you quick respond. That's really nice of you. Anyway, I tried both copying your codes over & I've tried to type in by myself. What it is doing is when I run the report, it'll ask for skip how many. I typed in 1 & the report just print at the 0 position. Here is the code: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [skipCounter] And [skipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [skipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [skipControl] = "Skip" Cancel = True End Sub I just copied and pasted this code, exactly as you sent it to me, into a label report. It works just fine. I'll have to re-iterate my question to you from the previous post... Did you add the 2 controls to the REPORT HEADER? Did you name those controls "SkipCounter" and "SkipControl"? Did you leave the Control Source of [SkipControl] blank? Now I'll add.. What happens if you enter 5 to skip instead of 1? Check Report Header Format and the Detail Print event lines (on the property sheet). Does that line on the property sheet say [Event Procedure]? It should. *** After thinking about it, I think this is the most likely problem. Did you try setting a breakpoint in the code, stepping through the code one line at a time, to read the values of SkipCounter and [SkipControl] to see what those values are as the report is running? In any event, the code is fine so it must be something else you have or have not done. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, Once again, thanks for you quick respond. Yes, I did what you have in the sample code. I also tried to put in 5 to skip instead of 1. I even double check the [Even Procedure] & it shows [Event Procedure] in the value of these properties. But 1 thing I don't know how is to set the breakpoint. Maybe you can give me some advice. I was thinking if I need to do anything in my report formatting. Thanks again in advance! |
#10
|
|||
|
|||
creating a label report in access
On Fri, 29 Aug 2008 07:39:02 -0700, jinh wrote:
"fredg" wrote: *** snipped *** I'm new to Access VBA coding. I've followed your steps above, & it still not skipping the label. Please advice of what I should do to fix this. Thank you in advance Sorry, I'm here and you're there, and I can't see your report. The above code works to skip missing label positions on a label sheet. I use it all the time. What does your report do? Does it not skip positions at all? Does it skip more positions than you entered? Did you add the controls to the Report Header? Did you name those controls "SkipCounter" and "SkipControl"? Do you get prompted for the number of labels to skip when you run the report? Does the report work properly otherwise? I would suggest you copy and paste into a reply message "your exact" code, including the Private Sub ... etc.. lines. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Sorry Fred, First, I like to thank you for you quick respond. That's really nice of you. Anyway, I tried both copying your codes over & I've tried to type in by myself. What it is doing is when I run the report, it'll ask for skip how many. I typed in 1 & the report just print at the 0 position. Here is the code: Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = [skipCounter] And [skipControl] = "Skip" Then Me.NextRecord = False Me.PrintSection = False Else [skipControl] = "No" Me.PrintSection = True Me.NextRecord = True End If End Sub Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) [skipControl] = "Skip" Cancel = True End Sub I just copied and pasted this code, exactly as you sent it to me, into a label report. It works just fine. I'll have to re-iterate my question to you from the previous post... Did you add the 2 controls to the REPORT HEADER? Did you name those controls "SkipCounter" and "SkipControl"? Did you leave the Control Source of [SkipControl] blank? Now I'll add.. What happens if you enter 5 to skip instead of 1? Check Report Header Format and the Detail Print event lines (on the property sheet). Does that line on the property sheet say [Event Procedure]? It should. *** After thinking about it, I think this is the most likely problem. Did you try setting a breakpoint in the code, stepping through the code one line at a time, to read the values of SkipCounter and [SkipControl] to see what those values are as the report is running? In any event, the code is fine so it must be something else you have or have not done. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, Once again, thanks for you quick respond. Yes, I did what you have in the sample code. I also tried to put in 5 to skip instead of 1. I even double check the [Even Procedure] & it shows [Event Procedure] in the value of these properties. But 1 thing I don't know how is to set the breakpoint. Maybe you can give me some advice. I was thinking if I need to do anything in my report formatting. Thanks again in advance! To set a Breakpoint in your code, open the code window (Click View + Code). Click in the left gray part of the code window alongside the line of code you wish to break on. In this case, we'll set 2 breakpoints. The first would be the Report Header Format line that says [SkipControl] = "Skip" and the second one is on the Detail Print line... If PrintCount = [skipCounter] And [skipControl] = "Skip" Then The lines will become highlighted and a large dot placed to the left of it. Exit the code window. Run the report. Enter, for example, 2 as the number of labels to skip. The report code will stop and highlight the line [SkipControl] = "Skip". While that line is highlighted, hover the cursor over [SkipControl]. It should read Null. Press F8. The next line should be highlighted. Hover the cursor over [SkipControl] again. It should now read "Skip". Does it? If so, next press F5. The report formatting will stop now at the point where the Detail Print event runs. You can then step through the code, line by line, either by clicking on the "Step Into" tool button, or pressing F8. Read the values of PrintCount, [SkipCounter] and [SkipControl] by hovering the cursor over each of them. The first time PrintCount should read 1, [SkipCounter] should be whatever the number of labels to skip you entered (2 in this case), and [SkipControl] should read "Skip". Press F8. The next line will be highlighted. Continue pressing F8 and read the values as they change. The first 2 times through, only the True part of the If statement will run and Next Record and PrintSection will be False. When PrintCount is greater than [SkipCounter], i.e. 3 in this case, the Else part of the If statement should run, and [SkipControl] should change to "No", NextRecord and PrintSection should then be true, and printing should occur. (Note you won't actually 'see' the printing occurring until you step all through the code, so at this point, click on the breakpoint dots to remove them. Press F5, to continue, and the page should appear, labels starting at position 3. If you still have a problem, let me know what the readings are. Don't forget to remove the breakpoints when done debugging. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
from a FORM print a label report 3 labels per sheet for CURRENT re | babs | Setting Up & Running Reports | 7 | February 6th, 2005 06:38 PM |
exporting accress reports into word | marc | General Discussion | 8 | December 29th, 2004 04:40 PM |
Save Report With CreateReport Coding Issue | Jeff Conrad | Setting Up & Running Reports | 8 | July 12th, 2004 08:39 AM |
OT- label making | Erika | Publisher | 4 | May 26th, 2004 06:27 AM |