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

Query result as the value of a textbox 1

Status
Not open for further replies.

jckokko

Programmer
Jun 4, 2001
31
US
On a report, I have a textbox. I would like the textbox's data source be a query result.
For example, the query statement is "select sum(amount) from ExpenseTable".
What's the work around?
 
Set the Control Source of the text box to...

"select sum(amount) from ExpenseTable".

=DSum("amount","ExpenseTable")

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Sorry I didn't mean to include your original line.

It should just be...


=DSum("amount","ExpenseTable")

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Is DSum(..) the only solution? I thought Dsum() func is not efficient (probably I am wrong about this).

Thank God for your help :)
 
Sorry for lack of explanation on the problem.
I have a select criteria:
select sum(amnt) from ExpenseTable where expenseType = "Auto" and anotherCriteria = "somethingElse".
 
Oops never mind!
I was too lazy to look up the usage of the DSum func. :)
I am alright now. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top