Show sum field based on dates select on form

G

Guest

I have created a query which shows the total hours for each day.

QueryName: TotalHours
FieldNames: DateRec
Hours

I want to create a form whereby my user can select a begin date and end
date, either from a drop down list or calendar, then have a text box that
shows the sum of hours between the 2 dates selected.

i.e. Begin date: 01/11/07 End Date: 10/11/07 Total Hours: 24

Any help given is much appreciated.
 
G

Guest

Try this as criteria on your DateRec field --
Between [Forms]![YourFormName]![BeginDateListBoxName] AND
[Forms]![YourFormName]![EndDateListBoxName]
 
G

Guest

Thank you.
I have created an unbound form [selectdate] with 2 text boxes to enter the
begin date and the end date.
I have created another form [sumhours], which uses the query TotalHours
containing the "between" code you gave, with the sum field on.

I have tried to use the [sumhours] form as a sub form on the [selectdate]
form but cannot get the subform to update everytime the dates are changed.

I have used a command button to open the [sumhours] form separately from the
main form and this does show the correct total for the dates selected but I
have to close the form and reopen everytime the date changes.

Can you give me some idea how to requery the subform from the mainform??

Many thanks


KARL DEWEY said:
Try this as criteria on your DateRec field --
Between [Forms]![YourFormName]![BeginDateListBoxName] AND
[Forms]![YourFormName]![EndDateListBoxName]
--
KARL DEWEY
Build a little - Test a little


Sue said:
I have created a query which shows the total hours for each day.

QueryName: TotalHours
FieldNames: DateRec
Hours

I want to create a form whereby my user can select a begin date and end
date, either from a drop down list or calendar, then have a text box that
shows the sum of hours between the 2 dates selected.

i.e. Begin date: 01/11/07 End Date: 10/11/07 Total Hours: 24

Any help given is much appreciated.
 

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