error choosing label

M

MexCham

I need to direct Access 07 to start printing with a certain label on the
sheet. I have reviewed the thread "choose label to start printing" on this
site, which gives the following instructions that were helpful to the person
that asked the question:

"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."


However, after I enter how many to skip, I get the message:

"Run-time error '2465':

Microsoft Office Access can't find the field "|" referred to in your
expression."

When I choose Debug, the line [SkipControl] = "Skip" is highlighted.


I copied everything straight out of the post and pasted it in, and I've
compared everything just to be sure it's not a typo. What did I do wrong?
Thanks!
 
F

fredg

I need to direct Access 07 to start printing with a certain label on the
sheet. I have reviewed the thread "choose label to start printing" on this
site, which gives the following instructions that were helpful to the person
that asked the question:

"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."

However, after I enter how many to skip, I get the message:

"Run-time error '2465':

Microsoft Office Access can't find the field "|" referred to in your
expression."

When I choose Debug, the line [SkipControl] = "Skip" is highlighted.

I copied everything straight out of the post and pasted it in, and I've
compared everything just to be sure it's not a typo. What did I do wrong?
Thanks!

Did you do this part?
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.
 
M

MexCham

I was hoping you'd be around today since it was your code! Thanks for taking
the time to look at it.

I did. At least, I think I did. I made a text box in the report header,
pasted SkipControl into the name line on the property sheet and left the
control source blank.

fredg said:
I need to direct Access 07 to start printing with a certain label on the
sheet. I have reviewed the thread "choose label to start printing" on this
site, which gives the following instructions that were helpful to the person
that asked the question:

"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."

However, after I enter how many to skip, I get the message:

"Run-time error '2465':

Microsoft Office Access can't find the field "|" referred to in your
expression."

When I choose Debug, the line [SkipControl] = "Skip" is highlighted.

I copied everything straight out of the post and pasted it in, and I've
compared everything just to be sure it's not a typo. What did I do wrong?
Thanks!

Did you do this part?
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.
 
F

fredg

I was hoping you'd be around today since it was your code! Thanks for taking
the time to look at it.

I did. At least, I think I did. I made a text box in the report header,
pasted SkipControl into the name line on the property sheet and left the
control source blank.

fredg said:
I need to direct Access 07 to start printing with a certain label on the
sheet. I have reviewed the thread "choose label to start printing" on this
site, which gives the following instructions that were helpful to the person
that asked the question:

"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."

However, after I enter how many to skip, I get the message:

"Run-time error '2465':

Microsoft Office Access can't find the field "|" referred to in your
expression."

When I choose Debug, the line [SkipControl] = "Skip" is highlighted.

I copied everything straight out of the post and pasted it in, and I've
compared everything just to be sure it's not a typo. What did I do wrong?
Thanks!

Did you do this part?
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.

I know this code works on Access versions up through Access 2003.
I have no experience with Access 2007, though I see no reason why it
shouldn't work.
I would offer to look at it, but not having Access 2007, I don't think
I would be able to even open it.
 
M

MexCham

I do have a machine running 03 with a previous version of the same database,
I will try to run it on there and see if it's a compatibility issue or if I
did it wrong. Thanks again for your time!

fredg said:
I was hoping you'd be around today since it was your code! Thanks for taking
the time to look at it.

I did. At least, I think I did. I made a text box in the report header,
pasted SkipControl into the name line on the property sheet and left the
control source blank.

fredg said:
On Wed, 19 Mar 2008 12:53:00 -0700, MexCham wrote:

I need to direct Access 07 to start printing with a certain label on the
sheet. I have reviewed the thread "choose label to start printing" on this
site, which gives the following instructions that were helpful to the person
that asked the question:

"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."

However, after I enter how many to skip, I get the message:

"Run-time error '2465':

Microsoft Office Access can't find the field "|" referred to in your
expression."

When I choose Debug, the line [SkipControl] = "Skip" is highlighted.

I copied everything straight out of the post and pasted it in, and I've
compared everything just to be sure it's not a typo. What did I do wrong?
Thanks!

Did you do this part?
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.

I know this code works on Access versions up through Access 2003.
I have no experience with Access 2007, though I see no reason why it
shouldn't work.
I would offer to look at it, but not having Access 2007, I don't think
I would be able to even open 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

Top