Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2004, 05:52 PM
Authorized User
 
Join Date: Apr 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADP OpenReport()

DoCmd.OpenReport "rptShipping", acViewPreview, , "dbo.orders.or_id = " & CStr(or_id)

Error:
"The column prefix does not match with a
table name or alias used in the query"

It really does though, Something with this being a ADP for sure

I was trying this, until I found there was no Open() method

Code:
   
Dim r As New Access.Report
r.Name = "rptShippingReportSuppliment_Receipts"
r.FilterOn = True
r.ServerFilter = "dbo.orders.or_id = " & CStr(or_id)
Any Workarounds ?


 
Old November 26th, 2004, 08:05 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

is this line really as it appears
Code:
DoCmd.OpenReport "rptShipping", acViewPreview, , "dbo.orders.or_id = " & CStr(or_id)
check the double comma
Code:
DoCmd.OpenReport "rptShipping", acViewPreview, "dbo.orders.or_id = " & CStr(or_id)
Jaime E. Maccou
Applications Analyst
 
Old November 26th, 2004, 08:11 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

sorry the comma belongs there

Try
Code:
Dim strDocName As String

strDocName = "rptShippingReportSuppliment_Receipts"
DoCmd.OpenReport strDocName, acViewPreview, , "Orders.or_ID = " + CStr(Me.Or_ID)
Jaime E. Maccou
Applications Analyst
 
Old November 27th, 2004, 03:31 PM
Authorized User
 
Join Date: Apr 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Same problem, can the input paramaters be of any help ?

 
Old November 27th, 2004, 06:44 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Yes, Please post your entire code.

Jaime E. Maccou
Applications Analyst
 
Old November 29th, 2004, 04:15 PM
Authorized User
 
Join Date: Apr 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't have any using input parameters yet,,,

Still with the column prefix dbo.orders does not match a table in your query
BUT IT DOES ! argh

 
Old November 29th, 2004, 04:58 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

What version of access are you using? Make sure you have the latest Microsoft Jet 4.0 Database Engine.

Jaime E. Maccou
Applications Analyst
 
Old November 29th, 2004, 05:37 PM
Authorized User
 
Join Date: Apr 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Access 2003 ADP - All Updated

The frustrating thing is that the report works perfectly on it's own, just not with the OpenReport() where clause


 
Old November 29th, 2004, 09:10 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Test this

Create a command button on your form using the wizard for printing a report.

Then look at the code generated and see it it works that way

Jaime E. Maccou
Applications Analyst





Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenReport ... how to size? seananderson Access VBA 3 March 2nd, 2007 08:44 AM
Where is the processing done in ADP Scripts82 Access VBA 3 March 23rd, 2006 12:00 AM
Chapter 11 OpenReport Erikj BOOK: Access 2003 VBA Programmer's Reference 0 January 3rd, 2006 11:58 AM
OpenReport Action Cancelled errror in Access 2003 JJ Access VBA 1 August 20th, 2004 09:27 AM
HEEELP!!! - strWhere Problem with DoCmd.OpenReport HenryE Access 1 August 4th, 2004 01:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.