creating a label report in access

J

jinh

fredg said:
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.

Hi Fred,

How are you doing? I'm sorry I still have not get you email. Please
re-send it as a zip file.

Thanks again!
 
J

jinh

fredg said:
Resent it as a Zipped file.

I got it Fred. I'll give it a try. Were you be able to take a look at
mind? I just want to know if it'll do the same as me. Please let me know.

Once again, thanks so much & I'll let you know after I've try your sample.
 
J

jinh

fredg said:
Resent it as a Zipped file.

Hi Fred,

Thank you very very much for all your helps.

I don't know what's in your sample rptSkipLabels, but here is what I did.

I unzipped you file.
I double click to launch the rptSkipLabels.
I open up the report & look at the number of skippes to verify it's working.
I close your rptSkipLabels.
I launch my application & everything works!

Hahah, don't know what kind of magic you have in your rptSkipLabels, but
it's all working now.

Once again, thank you so much guys for all your helps!
 
J

jinh

Hi Fred,

It's me again. Once again thanks for sharing your wonderful codings.

Anyway, I was trying to work on the Printing Duplicate Label on the same
page, & I got this debugging error which I have no idea how to fix it.

The error message says "Microsoft Office Access can't find the field "I"
refered to in your expression", & when I click on the Debug button it toke me
to the line where it coded as "If IsNull([RepeatCounter]) Then".

Any idea what I can do to fix this error?

Thanks in advance Fred!

JH


fredg said:
Thanks Fred, that worked for skipping labels...any suggestions on printing
duplicate same page labels??

:
*** 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.
 
J

jinh

Hi Fred,

Don't worry about my last post, it's my own issue. I had a typo in my code.
Sorry about that.

Thanks anyway!
JH

fredg said:
Thanks Fred, that worked for skipping labels...any suggestions on printing
duplicate same page labels??

:
*** 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.
 
C

Claire

I am running a label report in Access 2007 and entered this code for the
event procedure for the report header and the detail, and like JimH, have no
luck. It prints with the label in the 0 position. I tried to add a
breakpoint to watch the code, and though I could get it on the VBA page
(highlighted with a bullet to the left), I do not know how to find what the
values were. I hovered over the VBA page after running the report, but the
report itself just runs without any sort of indications. Does this code not
work in 2007? Is there something special that 07 wants? Am I just going
crazy?

Thanks,
Claire

jinh said:
fredg said:
*** 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.

Hi Fred,

I'm running access 2007. I've email the attached to you. Please let me know.

Thanks,
 
F

fredg

I am running a label report in Access 2007 and entered this code for the
event procedure for the report header and the detail, and like JimH, have no
luck. It prints with the label in the 0 position. I tried to add a
breakpoint to watch the code, and though I could get it on the VBA page
(highlighted with a bullet to the left), I do not know how to find what the
values were. I hovered over the VBA page after running the report, but the
report itself just runs without any sort of indications. Does this code not
work in 2007? Is there something special that 07 wants? Am I just going
crazy?

Thanks,
Claire

jinh said:
fredg said:
*** 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.

Hi Fred,

I'm running access 2007. I've email the attached to you. Please let me know.

Thanks,

I remember this original post as he originally sent me the database in
Access 2007 format and I wasn't able to open it, however I don't
remember the outcome. It wasn't the code.
If you found this old post perhaps you can go back and see if there is
a follow-up reply sent AFTER I looked at his database.

If you care to send me your database, I'll be happy to look at it. It
MUST be sent as an Access 2000 MDB format, which is one of the options
available in Tools + Database Utilities + Convert Database.
Strip everything out of the database that is not needed to run the
label report. I'll get back to you here in the newsgroup.
Send it to

jandf
at
roadrunner
dot
com

Make sure you write "Skip Labels" as the Subject line, otherwise I
will never see it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top