Subquery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subquery in a form and i was just wondering if i could retrive the
total of a column in the subquery and display that in a text box in my form

subquery - TimeCardCategoryQuerySubform
column in form - Hours
form - Team Member Input
text box - TotalHoursText
 
In the form text box control source you can write
=Sum([Hours])

Assuming the Hours is the name of field in the Query

Or, you can use if the form is not bounded to the query
=DSum("[Hours]","[TimeCardCategoryQuerySubform]")
 
I have another query with the same column header as hours. My goal was to add
both of them, so that have the sum of both query hours. I tried using the
dsum command and that just gave me a #error in the text box. I hvae no clue
what to do.

Ofer Cohen said:
In the form text box control source you can write
=Sum([Hours])

Assuming the Hours is the name of field in the Query

Or, you can use if the form is not bounded to the query
=DSum("[Hours]","[TimeCardCategoryQuerySubform]")

--
Good Luck
BS"D


tanhus said:
I have a subquery in a form and i was just wondering if i could retrive the
total of a column in the subquery and display that in a text box in my form

subquery - TimeCardCategoryQuerySubform
column in form - Hours
form - Team Member Input
text box - TotalHoursText
 
Can you post what you tried?

--
Good Luck
BS"D


tanhus said:
I have another query with the same column header as hours. My goal was to add
both of them, so that have the sum of both query hours. I tried using the
dsum command and that just gave me a #error in the text box. I hvae no clue
what to do.

Ofer Cohen said:
In the form text box control source you can write
=Sum([Hours])

Assuming the Hours is the name of field in the Query

Or, you can use if the form is not bounded to the query
=DSum("[Hours]","[TimeCardCategoryQuerySubform]")

--
Good Luck
BS"D


tanhus said:
I have a subquery in a form and i was just wondering if i could retrive the
total of a column in the subquery and display that in a text box in my form

subquery - TimeCardCategoryQuerySubform
column in form - Hours
form - Team Member Input
text box - TotalHoursText
 
i tried exactly what you told me to do.
=DSum("[Hours]","[TimeCardProjectsQuerySubform]")
This is the source in my text box

TimeCardProjectsQuerySubform is the sub query in the form
Hours is the column in the sub query

Ofer Cohen said:
Can you post what you tried?

--
Good Luck
BS"D


tanhus said:
I have another query with the same column header as hours. My goal was to add
both of them, so that have the sum of both query hours. I tried using the
dsum command and that just gave me a #error in the text box. I hvae no clue
what to do.

Ofer Cohen said:
In the form text box control source you can write
=Sum([Hours])

Assuming the Hours is the name of field in the Query

Or, you can use if the form is not bounded to the query
=DSum("[Hours]","[TimeCardCategoryQuerySubform]")

--
Good Luck
BS"D


:

I have a subquery in a form and i was just wondering if i could retrive the
total of a column in the subquery and display that in a text box in my form

subquery - TimeCardCategoryQuerySubform
column in form - Hours
form - Team Member Input
text box - TotalHoursText
 
Back
Top