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!

Report based on sql query

Status
Not open for further replies.

jurgen

Programmer
Feb 8, 2001
209
BE
Hi,

I'm trying to open a report based on an SQL string and not in a query.

Why do i that? Because the user fills in several fields and depending on those fields i build my query to show the result on a form. Now i want to print that result on paper, how can i tell the report to use that SQL string to be the data source of that report.

I tried several ways but none are succeslfull, can anyone help me or has some suggestions ?

Thx

Jurgen
 
I think there are two ways to go:

1. Use a saved query that is modified each time, and have a report based on that query. This is a bad idea in multi-user environments.

2. Store the SQL string in a global variable and read the string in the very first event on the form (look in the help for this or try a few events). You can set the recordsource of the report to this string. This technique won't work for subreports.

Best regards
 
Thnx ! It works like i want it

I didn't think about the global variable

Thnx again

Jurgen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top