printing report runtime error 3011

R

RedBeard

Hi,

I have made a report which I am trying to print only the current
record from.

Using the following:

Private Sub Print_Click()

Docmd.OpenReport "CD", acViewNormal, _
"[ID] = " & Me![ID]

End Sub


However, this gives me:

"Run-time error '3011':

The Microsoft Office Access database engine could not find the object
'[ID] = 181'. Make sure the object exists and that you spell its name
and path correctly."

ID 181 is one of the records in the table I am working from so the ID
exists.

So what am I doing wrong?

Cheers.
 
W

Wayne-I-M

DoCmd.OpenReport "CD", acViewNormal, , "ID = " & Me.ID

Make sure there is a control on the report (and the form) called ID and that
there is no filter on the report to stop this record being there
 
R

RedBeard

DoCmd.OpenReport "CD", acViewNormal, , "ID = " & Me.ID

Make sure there is a control on the report (and the form) called ID and that
there is no filter on the report to stop this record being there

--
Wayne
Manchester, England.

RedBeard said:
I have made a report which I am trying to print only the current
record from.
Using the following:
Private Sub Print_Click()
Docmd.OpenReport "CD", acViewNormal, _
"[ID] = " & Me![ID]
However, this gives me:
"Run-time error '3011':
The Microsoft Office Access database engine could not find the object
'[ID] = 181'. Make sure the object exists and that you spell its name
and path correctly."
ID 181 is one of the records in the table I am working from so the ID
exists.
So what am I doing wrong?

That did indeed work, thanks.

With one exception.

It prints two pages, one blank and one with info, any ideas as to why?
 
W

Wayne-I-M

Sorry don't know without seeing your application.

You could start with the obvious things 1st,
check the report margins,
check that your're not send blank records (with the report set to print each
record per page)
check that your report does not have the Force New Pages set to yes,
etc
etc

You would need to give more information as there are "many" reasons for a
report page printing blank.


--
Wayne
Manchester, England.



RedBeard said:
DoCmd.OpenReport "CD", acViewNormal, , "ID = " & Me.ID

Make sure there is a control on the report (and the form) called ID and that
there is no filter on the report to stop this record being there

--
Wayne
Manchester, England.

RedBeard said:
I have made a report which I am trying to print only the current
record from.
Using the following:
Private Sub Print_Click()
Docmd.OpenReport "CD", acViewNormal, _
"[ID] = " & Me![ID]
However, this gives me:
"Run-time error '3011':
The Microsoft Office Access database engine could not find the object
'[ID] = 181'. Make sure the object exists and that you spell its name
and path correctly."
ID 181 is one of the records in the table I am working from so the ID
exists.
So what am I doing wrong?

That did indeed work, thanks.

With one exception.

It prints two pages, one blank and one with info, any ideas as to why?
 
R

RedBeard

Sorry don't know without seeing your application.

You could start with the obvious things 1st,
check the report margins,
check that your're not send blank records (with the report set to print each
record per page)
check that your report does not have the Force New Pages set to yes,
etc
etc

You would need to give more information as there are "many" reasons for a
report page printing blank.

--
Wayne
Manchester, England.

RedBeard said:
DoCmd.OpenReport "CD", acViewNormal, , "ID = " & Me.ID
Make sure there is a control on the report (and the form) called ID and that
there is no filter on the report to stop this record being there
--
Wayne
Manchester, England.
:
Hi,
I have made a report which I am trying to print only the current
record from.
Using the following:
Private Sub Print_Click()
Docmd.OpenReport "CD", acViewNormal, _
"[ID] = " & Me![ID]
End Sub
However, this gives me:
"Run-time error '3011':
The Microsoft Office Access database engine could not find the object
'[ID] = 181'. Make sure the object exists and that you spell its name
and path correctly."
ID 181 is one of the records in the table I am working from so the ID
exists.
So what am I doing wrong?
Cheers.
That did indeed work, thanks.
With one exception.
It prints two pages, one blank and one with info, any ideas as to why?

Thanks again, it was the margins of 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