Need to use unbound calcuated total on subform in a query

C

C. Homey

In Access 2003:

I have a form and subform. The subform uses a query expression field
[HoursOut] to calculate the number of hours a person takes off in a
day. In order to get a running total of [HoursOut], I have an unbound
field [TotalHrs] in a group footer to sum [HoursOut].

Here's my problem:

I need to use the results of the [TotalHrs] (as it shows in the group
footer) in the main form's query and for the life of me I can't figure
out how to get it. Carryover Hours is a static field, with data
entered once each year. Yearly Hours is calculated based on
anniversary date.

Here is what it looks like, pictorially speaking:
_____________________________________________________________
MAIN FORM:

Carryover Yearly HOURS <-This is where I need to
Hours Hours REMAINING access totalhrs used to date>

27.25 175.00 (CarryOver + Yearly - TotalHrs)

SUBFORM:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Date Hours Worked Hours Out
1/1/01 8 am - 1 pm 4.00 <-query field calculates this>
2/1/01 12 pm - 5 pm 3.00
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SUBFORM GROUP FOOTER:
TotalHrs
Total Hours Used to Date: 7.00 <-I need to use this to calculate
HOURS REMAINING on the Form>
_____________________________________________________________

So... is this a pipe dream? Can anyone help me?
 
G

Gary Walter

Hi C.,

I am not familiar with a
subform *group* footer,
but if the txtbox is in the
subform's footer:

[Forms]![mainform]![subform].Form.Controls![txtbox]
 
C

C. Homey

Gary Walter said:
Hi C.,

I am not familiar with a
subform *group* footer,
but if the txtbox is in the
subform's footer:

[Forms]![mainform]![subform].Form.Controls![txtbox]

Thank you Gary - this was a big help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top