PC Review


Reply
Thread Tools Rate Thread

Compile error when implementing "How to skip Used Mailing Labels"

 
 
=?Utf-8?B?Qm9iIEI=?=
Guest
Posts: n/a
 
      15th Feb 2006
I get compile errors when trying to implement the "How to skip Used Mailing
Labels"
Article ID: 95806
On Print Property of label "MYLabels"
=LabelLayout(Reports![MyLabels])
Error is Expecting line number,or label or statement.
also
OnOpen property
=LabelSetup()
On Format property of Header
=LabelInitialize()
 
Reply With Quote
 
 
 
 
Brendan Reynolds
Guest
Posts: n/a
 
      15th Feb 2006
Probably, when you copied and pasted the code, you missed the first comment
character, i.e. the first line in your module begins with a * instead of a '

--
Brendan Reynolds
Access MVP

"Bob B" <(E-Mail Removed)> wrote in message
news:88D90723-628D-4713-803E-(E-Mail Removed)...
>I get compile errors when trying to implement the "How to skip Used Mailing
> Labels"
> Article ID: 95806
> On Print Property of label "MYLabels"
> =LabelLayout(Reports![MyLabels])
> Error is Expecting line number,or label or statement.
> also
> OnOpen property
> =LabelSetup()
> On Format property of Header
> =LabelInitialize()



 
Reply With Quote
 
=?Utf-8?B?Qm9iIEI=?=
Guest
Posts: n/a
 
      16th Feb 2006
Still get errors.
My Module looks like:

'*********************************************************
'Declarations section of the module.
'*********************************************************
Option Compare Database
Option Explicit

Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&

'==========================================================
' The following function will cause an input box to
' display when the report is run that prompts the user
' for the number of used labels to skip and how many
' copies of each label should be printed.
'===========================================================

Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"))
LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function

'===========================================================
' The following function sets the variables to a zero
'===========================================================

Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function

'===========================================================
' The following function is the main part of this code
' that allows the labels to print as the user desires.
'===========================================================

Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function

My report Looks like:

Option Compare Database

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
=LabelLayout (Reports![MyLabels])

End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
=LabelInitialize()
End Sub
Private Sub Report_Open(Cancel As Integer)
=LabelInitialize
End Sub



"Brendan Reynolds" wrote:

> Probably, when you copied and pasted the code, you missed the first comment
> character, i.e. the first line in your module begins with a * instead of a '
>
> --
> Brendan Reynolds
> Access MVP
>
> "Bob B" <(E-Mail Removed)> wrote in message
> news:88D90723-628D-4713-803E-(E-Mail Removed)...
> >I get compile errors when trying to implement the "How to skip Used Mailing
> > Labels"
> > Article ID: 95806
> > On Print Property of label "MYLabels"
> > =LabelLayout(Reports![MyLabels])
> > Error is Expecting line number,or label or statement.
> > also
> > OnOpen property
> > =LabelSetup()
> > On Format property of Header
> > =LabelInitialize()

>
>
>

 
Reply With Quote
 
Brendan Reynolds
Guest
Posts: n/a
 
      16th Feb 2006
The expressions (e.g. "=LabelLayout (Reports![MyLabels])",
"=LabelInitialize()") are supposed to go directly in the properties, not
into event procedures. Like so ...

http://brenreyn.brinkster.net/expression.jpg

--
Brendan Reynolds
Access MVP

"Bob B" <(E-Mail Removed)> wrote in message
news406CEE7-32DA-4D00-A39D-(E-Mail Removed)...
> Still get errors.
> My Module looks like:
>
> '*********************************************************
> 'Declarations section of the module.
> '*********************************************************
> Option Compare Database
> Option Explicit
>
> Dim LabelBlanks&
> Dim LabelCopies&
> Dim BlankCount&
> Dim CopyCount&
>
> '==========================================================
> ' The following function will cause an input box to
> ' display when the report is run that prompts the user
> ' for the number of used labels to skip and how many
> ' copies of each label should be printed.
> '===========================================================
>
> Function LabelSetup()
> LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"))
> LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))
> If LabelBlanks& < 0 Then LabelBlanks& = 0
> If LabelCopies& < 1 Then LabelCopies& = 1
> End Function
>
> '===========================================================
> ' The following function sets the variables to a zero
> '===========================================================
>
> Function LabelInitialize()
> BlankCount& = 0
> CopyCount& = 0
> End Function
>
> '===========================================================
> ' The following function is the main part of this code
> ' that allows the labels to print as the user desires.
> '===========================================================
>
> Function LabelLayout(R As Report)
> If BlankCount& < LabelBlanks& Then
> R.NextRecord = False
> R.PrintSection = False
> BlankCount& = BlankCount& + 1
> Else
> If CopyCount& < (LabelCopies& - 1) Then
> R.NextRecord = False
> CopyCount& = CopyCount& + 1
> Else
> CopyCount& = 0
> End If
> End If
> End Function
>
> My report Looks like:
>
> Option Compare Database
>
> Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
> =LabelLayout (Reports![MyLabels])
>
> End Sub
>
> Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
> Integer)
> =LabelInitialize()
> End Sub
> Private Sub Report_Open(Cancel As Integer)
> =LabelInitialize
> End Sub
>
>
>
> "Brendan Reynolds" wrote:
>
>> Probably, when you copied and pasted the code, you missed the first
>> comment
>> character, i.e. the first line in your module begins with a * instead of
>> a '
>>
>> --
>> Brendan Reynolds
>> Access MVP
>>
>> "Bob B" <(E-Mail Removed)> wrote in message
>> news:88D90723-628D-4713-803E-(E-Mail Removed)...
>> >I get compile errors when trying to implement the "How to skip Used
>> >Mailing
>> > Labels"
>> > Article ID: 95806
>> > On Print Property of label "MYLabels"
>> > =LabelLayout(Reports![MyLabels])
>> > Error is Expecting line number,or label or statement.
>> > also
>> > OnOpen property
>> > =LabelSetup()
>> > On Format property of Header
>> > =LabelInitialize()

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skip used mailing labels........ =?Utf-8?B?UGhpbA==?= Microsoft Access Reports 1 10th Aug 2007 02:29 AM
Get "#ERROR" on labels on mailing list. Why? vikenk@aol.com Microsoft Access 6 30th May 2006 02:07 PM
Skip used mailing labels =?Utf-8?B?QWxpc29u?= Microsoft Access Forms 2 5th May 2006 11:26 PM
Print Access 97 Mailing Labels in the "middle" of a sheet of label =?Utf-8?B?VERNdWVsbGVy?= Microsoft Access Reports 7 22nd Dec 2004 04:03 AM
Re: Getting "compile error" "method or data member not found" on reinstall Bp Microsoft Excel Programming 0 23rd Apr 2004 04:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:11 PM.