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

Use an Access query with criteria for a report???

Status
Not open for further replies.

DarnImGood

Programmer
Jul 14, 2004
1
US
Software I'm using: MS Access XP, Crystal Reports 9

My background: Access master, Crystal beginner

My goal: Run a Crystal report via ActiveX and Crystal viewer in Access based on values specified by a form in Access.

Here's my problem: There is gobs of documentation on using a basic parameter query from Access in Crystal where the Criteria for a field in the Access query is something like [Enter value]. What I want to do is use the same query, but with the criteria grabbing a value from a form like this, [forms]![MyForm]![Text1]. When you run this query in Access, as long as MyForm is open with a value in Text1, you will get a record returned. Crystal does not understand this! Instead of using the record returned by the query, Crystal insists that [forms]![MyForm]![Text1] is not a reference to a value, but a regular old parameter prompt such as [Enter value]! How do I tell Crystal to just run the query and use the record that is returned??? Is is even possible to run a dynamic query from Crystal like this? Thanks in advance for any help!
 
One easy option is to create the parameter in Crystal, use it in the record selection formula (in Crystal), and set the value of the parameter using the RDC API.

You can read about setting a parameter value through the RDC in the developer online help or even download sample Access RDC application from Crystal tech support site.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top