Dsum-in subform_footer (passing value back into subform

B

babs

I am getting an error# not sure where syntax wrong also want to add criteria
where workdate is from 1/1/09 to 12/31/09 since trying to total yearly
vacation taken??

HoursVacaCor - is a field that corrects if hoursvaca is null and put in a 0
if it is null otherwise puts in Hoursvaca.

Putting this below code in th footer of the subform but getting an error -
query name and field names are correct???

want to total each employees vacation take within this year???
=DSum("([HoursVacaCor])","JeffTime Card MD Query","[Man Name] = " & [Man
name])

any ideas??-
Barb
 
B

babs

No, I am just only in the footer of the subform referencing ONLY fields that
are on the subform???-trying to total all vaction for each [man name] would
love to add only for workdate from 1/1/09 to 12/31/09 also - but even without
it getting error??


thanks,
Barb

Richard said:
Hi Barb,

It sounds like you are trying to reference a control on a subform. Take a
look at this link.

http://www.mvps.org/access/forms/frm0031.htm

Richard



babs said:
I am getting an error# not sure where syntax wrong also want to add criteria
where workdate is from 1/1/09 to 12/31/09 since trying to total yearly
vacation taken??

HoursVacaCor - is a field that corrects if hoursvaca is null and put in a 0
if it is null otherwise puts in Hoursvaca.

Putting this below code in th footer of the subform but getting an error -
query name and field names are correct???

want to total each employees vacation take within this year???
=DSum("([HoursVacaCor])","JeffTime Card MD Query","[Man Name] = " & [Man
name])

any ideas??-
Barb
 
J

John Spencer

Assumption is that Man Name is a text field. If so, you need to include quote
marks as delimiters. Also, you have () in the first argument which is
supposed to the be the field (column) name and lack square brackets around the
query name.

=DSum("[HoursVacaCor]","[JeffTime Card MD Query]","[Man Name]= """ & [Man
name] & """")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
F

Frank H

In addition, if you wanted to restrict to specific dates, assuming the date
field is a field in "[JeffTime Card MD Query]", you could modify the WHERE
argument to include criteria on the date. Something like...

"[Man Name]= """ & [Man name] & """" & " AND [DateFieldName] Between
#1/1/09# AND #12/31/09#"
--
Frank H
Rockford, IL


John Spencer said:
Assumption is that Man Name is a text field. If so, you need to include quote
marks as delimiters. Also, you have () in the first argument which is
supposed to the be the field (column) name and lack square brackets around the
query name.

=DSum("[HoursVacaCor]","[JeffTime Card MD Query]","[Man Name]= """ & [Man
name] & """")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I am getting an error# not sure where syntax wrong also want to add criteria
where workdate is from 1/1/09 to 12/31/09 since trying to total yearly
vacation taken??

HoursVacaCor - is a field that corrects if hoursvaca is null and put in a 0
if it is null otherwise puts in Hoursvaca.

Putting this below code in th footer of the subform but getting an error -
query name and field names are correct???

want to total each employees vacation take within this year???
=DSum("([HoursVacaCor])","JeffTime Card MD Query","[Man Name] = " & [Man
name])

any ideas??-
Barb
 
B

babs

Thanks so much the code "works" - no error# or Name?- BUT

Field Worker Job # Workdate Vacation Time (hours) VH TotVacTak
CAGNEY, KEVIN 90180056 9/28/2009 0 12

CAGNEY, KEVIN 90180056 9/29/2009 0 12

CAGNEY, KEVIN 90180056 9/30/2009 0 12

CAGNEY, KEVIN 90180056 10/1/2009 8 12
8
CAGNEY, KEVIN 90180056 10/2/2009 4 12

the 1st column of VH(vacation taken) shows the acutal date the vacation
taken. the second column is the DSUM- formula - text box (passed back in
based off the the dsum by man name and date within 2009) the total is
correct - BUT DO NOT LIKE that the dates prior to it taken(9/28-9/30/09) show
up as having used 12 hours of vacaction - anyway to add code in to it show a
Running Actual total -

Thanks sooo much for helping!
Barb

Frank H said:
In addition, if you wanted to restrict to specific dates, assuming the date
field is a field in "[JeffTime Card MD Query]", you could modify the WHERE
argument to include criteria on the date. Something like...

"[Man Name]= """ & [Man name] & """" & " AND [DateFieldName] Between
#1/1/09# AND #12/31/09#"
--
Frank H
Rockford, IL


John Spencer said:
Assumption is that Man Name is a text field. If so, you need to include quote
marks as delimiters. Also, you have () in the first argument which is
supposed to the be the field (column) name and lack square brackets around the
query name.

=DSum("[HoursVacaCor]","[JeffTime Card MD Query]","[Man Name]= """ & [Man
name] & """")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I am getting an error# not sure where syntax wrong also want to add criteria
where workdate is from 1/1/09 to 12/31/09 since trying to total yearly
vacation taken??

HoursVacaCor - is a field that corrects if hoursvaca is null and put in a 0
if it is null otherwise puts in Hoursvaca.

Putting this below code in th footer of the subform but getting an error -
query name and field names are correct???

want to total each employees vacation take within this year???
=DSum("([HoursVacaCor])","JeffTime Card MD Query","[Man Name] = " & [Man
name])

any ideas??-
Barb
 
B

babs

Any idea on how to handle my 10/6 POST????
thanks again for helping
Barb

John Spencer said:
Assumption is that Man Name is a text field. If so, you need to include quote
marks as delimiters. Also, you have () in the first argument which is
supposed to the be the field (column) name and lack square brackets around the
query name.

=DSum("[HoursVacaCor]","[JeffTime Card MD Query]","[Man Name]= """ & [Man
name] & """")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I am getting an error# not sure where syntax wrong also want to add criteria
where workdate is from 1/1/09 to 12/31/09 since trying to total yearly
vacation taken??

HoursVacaCor - is a field that corrects if hoursvaca is null and put in a 0
if it is null otherwise puts in Hoursvaca.

Putting this below code in th footer of the subform but getting an error -
query name and field names are correct???

want to total each employees vacation take within this year???
=DSum("([HoursVacaCor])","JeffTime Card MD Query","[Man Name] = " & [Man
name])

any ideas??-
Barb
 

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