Totals on a Form

  • Thread starter Thread starter Mickey Z.
  • Start date Start date
M

Mickey Z.

Hello.

I have created a project tracking database that contains a form for entering
and viewing data for each unique project ID. I also have a table for time
tracking so that I can track how many hours are spent working on each
project. This table can have many entries for each project.

I created a query to total the number of hours by project ID. I want to use
this query to feed my main form with the total for each unique project. In
my main form, I am trying to use an IIF statement that returns the total
hours from the query if the project ID matches that on the main form/table.
I am getting a #Name? error in the total hours text box and I can't figure
out why.

The main table and the time tracking table are linked by the project ID.
Any help or suggestions would be greatly appreciated.

Thank you.

Mickey
 
Feed your form using a query. Join the query to total the number of hours by
project ID in the query on project ID.
 
Thanks, Karl. I don't mean to sound dumb but how do you do that? I already
have Project ID joined to Project ID on the two tables. Here is the syntax I
am using for the xpression in [Hours Spent] on the form:

=IIf([Main Table]![Project ID]=[Project Time Summary]![Project ID],[Project
Time Summary]![Total Hours],"Unknown")

.....where [Project Time Summary] is the name of the query. The query runs
fine by itself.

Mickey
 
Create a query in design view using your [Main Table] and [Project Time
Summary] query.
Click on the [Main Table].[Project ID] and drag to the [Project Time
Summary].[Project ID] to join the two.
Drag down the desired fields from [Main Table] and [Project Time Summary]
query.
--
KARL DEWEY
Build a little - Test a little


Mickey Z. said:
Thanks, Karl. I don't mean to sound dumb but how do you do that? I already
have Project ID joined to Project ID on the two tables. Here is the syntax I
am using for the xpression in [Hours Spent] on the form:

=IIf([Main Table]![Project ID]=[Project Time Summary]![Project ID],[Project
Time Summary]![Total Hours],"Unknown")

....where [Project Time Summary] is the name of the query. The query runs
fine by itself.

Mickey

KARL DEWEY said:
Feed your form using a query. Join the query to total the number of hours by
project ID in the query on project ID.
 
Karl,

I've done this. The query works. How do I get the total hours into the
"Total Hours" field on the form? What is the correct syntax?

Thanks.

Mickey

KARL DEWEY said:
Create a query in design view using your [Main Table] and [Project Time
Summary] query.
Click on the [Main Table].[Project ID] and drag to the [Project Time
Summary].[Project ID] to join the two.
Drag down the desired fields from [Main Table] and [Project Time Summary]
query.
--
KARL DEWEY
Build a little - Test a little


Mickey Z. said:
Thanks, Karl. I don't mean to sound dumb but how do you do that? I already
have Project ID joined to Project ID on the two tables. Here is the syntax I
am using for the xpression in [Hours Spent] on the form:

=IIf([Main Table]![Project ID]=[Project Time Summary]![Project ID],[Project
Time Summary]![Total Hours],"Unknown")

....where [Project Time Summary] is the name of the query. The query runs
fine by itself.

Mickey

KARL DEWEY said:
Feed your form using a query. Join the query to total the number of hours by
project ID in the query on project ID.
--
KARL DEWEY
Build a little - Test a little


:

Hello.

I have created a project tracking database that contains a form for entering
and viewing data for each unique project ID. I also have a table for time
tracking so that I can track how many hours are spent working on each
project. This table can have many entries for each project.

I created a query to total the number of hours by project ID. I want to use
this query to feed my main form with the total for each unique project. In
my main form, I am trying to use an IIF statement that returns the total
hours from the query if the project ID matches that on the main form/table.
I am getting a #Name? error in the total hours text box and I can't figure
out why.

The main table and the time tracking table are linked by the project ID.
Any help or suggestions would be greatly appreciated.

Thank you.

Mickey
 
Back
Top