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

Using SQL statements in Control Source (Reports)???

Status
Not open for further replies.

nachoman88

Programmer
Jul 23, 2002
2
CA
Hi, this question might sound pretty newbie to some... your probably right :) I'm fairly new to access (using 97 at work) and I was wondering if it was possible to include some SQL statements inside a report. If so, can it be used inside a TextBox under its 'Control Source' attribute?

Anyhelp would be appreciated,
Thanks,

nachoman88
 
you can write a query to be the control source of the entire report, and then you will be able to select the returned fields of the query as the control source for one of your controls on the report.

hth
-Mike
 
Yep, thanks!

Also, is there a way to include more than one SQL statement inside the same query? I'm reusing the same tables but specifiying a different range in it to count from. If I use the 'Design View' in Access97 for each query (with different range), Access combines them into one with the 'AND' thus resulting in the total of all the ranges. What I want is the count for each range, not the count for the total of the ranges specified.

Hope it doesn't sound to complicated...
thanks,

nachoman88
 
not sure what you're asking, but this is straight out of ACcess help...
If you're using a subquery to define criteria for a field, type a SELECT statement in the Criteria cell of the field for which you want to set criteria. Place the SELECT statement in parentheses. If you're using a subquery to define a Field cell, type a SELECT statement enclosed in parentheses in a Field cell. After you leave the cell, Microsoft Access automatically inserts "Expr1:", "Expr2:", and so on, before the SELECT statement.

-mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top