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 |
#11
|
|||
|
|||
creating a label report in access
"fredg" wrote: 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 Hi Fred, Thanks again! I followed your steps to set a breakpoint. But nothing happen after I entered 2 in the [Skip How Many?] box. It just take me to the report. Any other idea? Should I email you the whole access database? Please let me know. Thanks again in advance! |
#12
|
|||
|
|||
creating a label report in access
*** snipped ***
Thanks again! I followed your steps to set a breakpoint. But nothing happen after I entered 2 in the [Skip How Many?] box. It just take me to the report. Any other idea? Should I email you the whole access database? Please let me know. Thanks again in advance! Are you using Access 2000 or 2002? Are you using Access 2003? Saving data in the 2000 or 2002 format? Alright, you twisted my arm. ;-) Access 2007? Sorry, I have no way off running it as is. Perhaps you can Convert it into an earlier version... Tools + Database Utilities + Convert Database to 2002 version. It the Database is small, you can send it as is. If the database is large, strip everything out that is not needed to run the label report. All I need is enough records to print 2 pages of labels, or fewer. Compact the database to make sure it compiles. Try it before sending it. No need to Zip the file. Make sure it does not have workgroup security so that I can open it. Send it to jandf at roadrunner. com I'm sure you can properly reconstruct that address. MAKE SURE you write, as the subject line: "Skip Labels" otherwise I will never see it. I'll reply here in the newsgroup. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#13
|
|||
|
|||
creating a label report in access
"fredg" wrote: *** snipped *** Thanks again! I followed your steps to set a breakpoint. But nothing happen after I entered 2 in the [Skip How Many?] box. It just take me to the report. Any other idea? Should I email you the whole access database? Please let me know. Thanks again in advance! Are you using Access 2000 or 2002? Are you using Access 2003? Saving data in the 2000 or 2002 format? Alright, you twisted my arm. ;-) Access 2007? Sorry, I have no way off running it as is. Perhaps you can Convert it into an earlier version... Tools + Database Utilities + Convert Database to 2002 version. It the Database is small, you can send it as is. If the database is large, strip everything out that is not needed to run the label report. All I need is enough records to print 2 pages of labels, or fewer. Compact the database to make sure it compiles. Try it before sending it. No need to Zip the file. Make sure it does not have workgroup security so that I can open it. Send it to jandf at roadrunner. com I'm sure you can properly reconstruct that address. MAKE SURE you write, as the subject line: "Skip Labels" otherwise I will never see it. I'll reply here in the newsgroup. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, I'm running access 2007. I've email the attached to you. Please let me know. Thanks, |
#14
|
|||
|
|||
creating a label report in access
"fredg" wrote: *** snipped *** Thanks again! I followed your steps to set a breakpoint. But nothing happen after I entered 2 in the [Skip How Many?] box. It just take me to the report. Any other idea? Should I email you the whole access database? Please let me know. Thanks again in advance! Are you using Access 2000 or 2002? Are you using Access 2003? Saving data in the 2000 or 2002 format? Alright, you twisted my arm. ;-) Access 2007? Sorry, I have no way off running it as is. Perhaps you can Convert it into an earlier version... Tools + Database Utilities + Convert Database to 2002 version. It the Database is small, you can send it as is. If the database is large, strip everything out that is not needed to run the label report. All I need is enough records to print 2 pages of labels, or fewer. Compact the database to make sure it compiles. Try it before sending it. No need to Zip the file. Make sure it does not have workgroup security so that I can open it. Send it to jandf at roadrunner. com I'm sure you can properly reconstruct that address. MAKE SURE you write, as the subject line: "Skip Labels" otherwise I will never see it. I'll reply here in the newsgroup. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, I'm running access 2007. Sorry, I should of let you know at first. Anyway, I've attached the database & emailed to you. Please take a look & let me know. Thanks, |
#15
|
|||
|
|||
creating a label report in access
"jinh" wrote in message:
... Hi Fred, I'm running access 2007. I've email the attached to you. Please let me know. Thanks, Are you opening the report in Print Preview view or the new Report View in Access 2007? If you're opening the report in Report View, try opening it in Print Preview instead. Not all events run in the new Report View. -- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- |
#16
|
|||
|
|||
creating a label report in access
"Jeff Conrad [MSFT]" wrote: "jinh" wrote in message: ... Hi Fred, I'm running access 2007. I've email the attached to you. Please let me know. Thanks, Are you opening the report in Print Preview view or the new Report View in Access 2007? If you're opening the report in Report View, try opening it in Print Preview instead. Not all events run in the new Report View. -- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- Hi Jeff, Thank you for joining in to provide your help! I've changed the default view of the report to open in Print Preview, & I still get no luck. If you have any other advice, I will not mind to take it. Thanks again! |
#17
|
|||
|
|||
creating a label report in access
On Fri, 29 Aug 2008 22:23:00 -0700, jinh wrote:
** snipped ** Hi Jeff, Thank you for joining in to provide your help! I've changed the default view of the report to open in Print Preview, & I still get no luck. If you have any other advice, I will not mind to take it. Thanks again! Jin, I sent you a sample Access 2002 database. Did you get it? Were you able to open it? Were you able to see how it worked? -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#18
|
|||
|
|||
creating a label report in access
"fredg" wrote: On Fri, 29 Aug 2008 22:23:00 -0700, jinh wrote: ** snipped ** Hi Jeff, Thank you for joining in to provide your help! I've changed the default view of the report to open in Print Preview, & I still get no luck. If you have any other advice, I will not mind to take it. Thanks again! Jin, I sent you a sample Access 2002 database. Did you get it? Were you able to open it? Were you able to see how it worked? -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, No, I've not get it yet. When did you send it? Just in case, my email is Would there be a different in Access 2007? Because the database that I've email to you it's in Access 2007 & I don't know if I can down grade it to Access 2002 as my office are runing in Access 2007. Any other idea? Thanks again in advance! |
#19
|
|||
|
|||
creating a label report in access
jinh,
I have a sample A97 database that will print any quantity of any number of labels starting at any location on a sheet of labels. It assumes that all the blank spaces on a sheet of labels start at the top left and work across then down. It also assumes that every sheet of labels after the first sheet is full. The mdb file is less than 300 KB. I'll send it as an attachment in an Email if you want. Give me an address. It is a very simple program. It's possible that it will run in A07. Chuck -- |
#20
|
|||
|
|||
creating a label report in access
On Fri, 29 Aug 2008 23:08:00 -0700, jinh wrote:
"fredg" wrote: On Fri, 29 Aug 2008 22:23:00 -0700, jinh wrote: ** snipped ** Hi Jeff, Thank you for joining in to provide your help! I've changed the default view of the report to open in Print Preview, & I still get no luck. If you have any other advice, I will not mind to take it. Thanks again! Jin, I sent you a sample Access 2002 database. Did you get it? Were you able to open it? Were you able to see how it worked? -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Hi Fred, No, I've not get it yet. When did you send it? Just in case, my email is Would there be a different in Access 2007? Because the database that I've email to you it's in Access 2007 & I don't know if I can down grade it to Access 2002 as my office are runing in Access 2007. Any other idea? Thanks again in advance! Yes, that was the address I sent it to. Perhaps it was not received because it had a .mdb file attached. Check your e-mail security settings. I re-sent it to the above address this morning. Hope you can open it. -- 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 |