Address Labels, Thanks Fred

G

Guest

Thanks for the help Fred!!

Fred

I have completed your instructions and have received the following syntax error

***The expression may not result in the nameof the macro, the name of a user defined funtion, or [EventProcedure]

***There may have been an error evaluating the function, event or macro

Any ideas of how to correct these errors?
 
F

fredg

Thanks for the help Fred!!!

Fred,

I have completed your instructions and have received the following syntax error:

***The expression may not result in the nameof the macro, the name of a user defined funtion, or [EventProcedure].

***There may have been an error evaluating the function, event or macro.

Any ideas of how to correct these errors?

Well, I'm Fred, one of several answering questions in this and other
Access news groups.
Since you haven't included any part of the previous post in this new
thread, if this is a question in regards to one of my responses, I
have no idea what instructions you are referring to.

All I can see from this post, is that you probably attempted to write
some code ON THE EVENT LINE, rather than in the event window.

If you would care to post back IN THE SAME THREAD, and include the
message part that this refers to, and where you attempted to write
the code, I, or some one else, will be glad to take a look.
 
G

Guest

I am attempting to create a report in Aceess using the Label Wizard
What my question is, is it possible to create a full page of th
same label in the Label Wizard with multiple names and addresses i
my Table??? If anyone could help, it would be greatly appreciated

Nelson
Not using the wizard
This will permit you to enter the number of times to repeat th
labels, as well as skip missing label positions on an already use
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 SkipCounte
2) Leave the second control unbound
Name this control SkipContro
3) Set the third control's Control Source to
=[Repeat how many
Name it RepeatCounte

Next code the Report Header OnFormat event

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount A
Integer
[SkipControl] = "Skip
Cancel = Tru
End Su
======
Now code the Detail OnPrint Event
(Note that intMyPrint is Static!!

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer
Static intMyPrint As Intege
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip" The
Me.NextRecord = Fals
Me.PrintSection = Fals
intMyPrint =
Els
[SkipControl] = "No
Me.PrintSection = Tru
Me.NextRecord = Tru
intMyPrint = intMyPrint +
If IsNull([RepeatCounter]) The
ElseIf intMyPrint Mod [RepeatCounter] = 0 The
Me.NextRecord = Tru
intMyPrint =
Els
Me.NextRecord = Fals
End I
End I

End Su
========

When you run the report, it will ask how many labels to skip, then ho
many times to repeat each label

Hope this has helped

--
Fred Please only reply to this newsgroup. I do not reply to persona
email


----- fredg wrote: ----

On Thu, 19 Feb 2004 11:36:08 -0800, Nelson James wrote
Thanks for the help Fred!!
Fred
I have completed your instructions and have received the following syntax error
***The expression may not result in the nameof the macro, the name of a user defined funtion, or [EventProcedure]
***There may have been an error evaluating the function, event or macro
Any ideas of how to correct these errors

Well, I'm Fred, one of several answering questions in this and othe
Access news groups
Since you haven't included any part of the previous post in this ne
thread, if this is a question in regards to one of my responses,
have no idea what instructions you are referring to

All I can see from this post, is that you probably attempted to writ
some code ON THE EVENT LINE, rather than in the event window

If you would care to post back IN THE SAME THREAD, and include th
message part that this refers to, and where you attempted to writ
the code, I, or some one else, will be glad to take a look
 
F

fredg

I am attempting to create a report in Aceess using the Label Wizard.
What my question is, is it possible to create a full page of the
same label in the Label Wizard with multiple names and addresses in
my Table??? If anyone could help, it would be greatly appreciated!

Nelson,
Not using the wizard.
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.

Hope this has helped.

OK, so this is giving you an error message that Access 'can't find the
macro,' etc.

I made an assumption, when I originally replied to your first message,
that you had already made a Label report and wanted to print more than
one label for the same record., i.e. 3 labels to John Smith. Was that
assumption correct, that you already have the label report done? The
follow up gave you a method to repeat the same label several times in
the report. Is that what you are still trying to do?

Have you entered code into an Access event procedure before.
I'm going to assume you haven't. Please excuse me if I go to a low
experience level for you, as I don't know where to start other than at
the beginning.

First add the 3 controls to the Report Header.
Set their control source as indicated.
Name the controls as indicated.

To enter code for the Report Header event,
Right-Click anywhere in an empty part of the Report Header.
Display the Report Header's property sheet.
Click on the Events tab.
On the Format event line write:
[Event Procedure]
Click on the little button with 3 dots that will appear.
When the Format event code window opens, the cursor will flash between
2 already existing lines of code.
Type the code for that event between those 2 lines.
*** Do NOT duplicate the first or the last code lines.***
Exit the code window.

Do the same for the Detail Print event.

The report should now give you the choice of how many used label
positions to skip, and how many of each label to print.

Now if my original premise was incorrect, and you have not already
made a label report, click on the Reports object of your database
folder and Click New. When the New Report dialog opens, one of the
selections will be the 'Label Wizard'. Select that and follow the
instructions.
When done run the report and make sure it prints 1 label for each
record properly. Then, if all is well, go and add my above code to the
report.
 

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

Top