Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open report in access

Status
Not open for further replies.

jordanking

Programmer
Sep 8, 2005
351
Hello,

I tried to search this out but am still stuck,

I am trying to use the following code to open a report in access 2003
Code:
DoCmd.OpenReport "rptPurchase", acViewPreview, , "[idsPurchID] = 3235", acWindowNormal

but the program then pops open a dialoge box asking for the value of the "idsPurchID" parameter. I thought that was what I was assign with the above code.

can someone help me

Thanks in advance

JK
 



Hi,

"[idsPurchID] = 3235"

and [idsPurchID] is defined as a NUMERIC TYPE? Esh!

Skip,

[glasses] [red][/red]
[tongue]
 
Yes, it is defined as a numberic value. Actually it is the auto increment vale for one of the tables that the report pulls from.

The actual field name or table coloumn is idsPurchID but the control on the form that the value is bound to is "purID"

Does that help?

 


try quallifying it, like...
Code:
"[MyTable].[idsPurchID] = 3235"


Skip,

[glasses] [red][/red]
[tongue]
 
Thanks for the reply,

I tried both
[tblPurchaseTransactions]![idsPurchID]
and
[tblPurchaseTransactions].[idsPurchID]

but got the same problem, it is still asking for the value of the parameter named "tblPurchaseTransactions!idsPurchID"

 
What is the SQL code of the Report.RecordSource ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, the report is based directly on a table. I have not set the recordset dynamicallt through VBA. I assigned it through the general GUI of access. It also contains a subform based on another table that refrences the main auto increment ID of the parent form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top