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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Report Problem

Status
Not open for further replies.

tpoettker

Programmer
Jan 4, 2002
41
US
Hi,

I am new to Access and have been asked to create a report and, using data from a SQL query and some logic, post the data into the report.

I have created the report, connected to SQL server using ADODB connection and executed the stored procedure. This part works fine.

It's the next part, I can't seem to get past. Nothing I have tried works. I want to take the value a field from the query and place the value in a field on the report.

I have tried
DoCmd.OpenReport, ReportName, acViewDesign.

This returns an error message that says "This action can't be carried out while processing a form or report event.@A macro specified as the OnOpen, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.@When you click OK, an Action Failed"

I have changed acViewDesign to acViewPreview only to receive a different error.

If I don't use the openreport command, then I receive an error that I am trying to add a value to a read-only form.

Any ideas?

Thanks
Tina
 
Hi

You are on the wrong track

You create a report, set its recordsource to the recordset you have retrieved from the SQl query and now you can place controls on the report which are 'bound' to columns in teh query

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top