If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
printing report runtime error 3011
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. |
#2
|
|||
|
|||
printing report runtime error 3011
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" wrote: 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. |
#3
|
|||
|
|||
printing report runtime error 3011
On Sep 8, 12:43*pm, Wayne-I-M
wrote: 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" wrote: 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? |
#4
|
|||
|
|||
printing report runtime error 3011
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" wrote: On Sep 8, 12:43 pm, Wayne-I-M wrote: 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" wrote: 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? |
#5
|
|||
|
|||
printing report runtime error 3011
On Sep 8, 1:54*pm, Wayne-I-M
wrote: 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" wrote: On Sep 8, 12:43 pm, Wayne-I-M wrote: 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" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|