Subform calculations per JobNo to show on main form?!?

H

hermondo

New member alert, am a bit of a novice with Access, but learning quickly!

I have a form 'frmjobplan' with a subform 'frmhours' which contains job
number, date, hours and machine process. Basically the user will be on the
frmjobplan on a certain job number, this job number is linked to the
jobnumber in the subform with master and child.

The problem im having is with an 'Actual Hours' box on the main form which i
want to display a total of hours per job in the subform.

I have added a txt box in the footer of the subform 'frmhours' with the
formula ""=Sum([Hours])"" which when i click the frmhours on is own, it
successfuly displays the sum of all the hours, but not by job.

I have added this to the control source of the 'Actual Hours' box on the main
form

=frmhours.Form!sumofhours

but when the form is opened it just displays "name?" in the Actual hours box.

Can anybody help?

Thanks in advance!!!
 
T

Tom van Stiphout

Welcome.
The error means you did not specify a correct name. So either the name
of the subform control is not "frmhours", or the name of the textbox
with formula is not "sumofhours". I suspect the first: note that this
should be the name of the subform CONTROL, not the name of the form
hosted in it.

-Tom.
Microsoft Access MVP
 
H

hermondo

thanks for your reply!

Have double checked the naming and its definately all spelt correctly,
'frmhours' and 'sumofhours' although the can i clarify on where i would find
the CONTROL name?

Thanks again
Welcome.
The error means you did not specify a correct name. So either the name
of the subform control is not "frmhours", or the name of the textbox
with formula is not "sumofhours". I suspect the first: note that this
should be the name of the subform CONTROL, not the name of the form
hosted in it.

-Tom.
Microsoft Access MVP
New member alert, am a bit of a novice with Access, but learning quickly!
[quoted text clipped - 20 lines]
Thanks in advance!!!
 
P

Piet Linden

New member alert, am a bit of a novice with Access, but learning quickly!

I have a form 'frmjobplan' with a subform 'frmhours' which contains job
number, date, hours and machine process. Basically the user will be on the
frmjobplan on a certain job number, this job number is linked to the
jobnumber in the subform with master and child.

The problem im having is with an 'Actual Hours' box on the main form which i
want to display a total of hours per job in the subform.

I have added a txt box in the footer of the subform 'frmhours' with the
formula   ""=Sum([Hours])"" which when i click the frmhours on is own, it
successfuly displays the sum of all the hours, but not by job.

I have added this to the control source of the 'Actual Hours' box on the main
form

=frmhours.Form!sumofhours

but when the form is opened it just displays "name?" in the Actual hours box.

Can anybody help?

Thanks in advance!!!

Subform syntax can be a headache. Keri Hardwick wrote a really
helpful article that sorts it out, which is here...
http://www.mvps.org/access/forms/frm0031.htm
 
T

Tom van Stiphout

I wanted to make sure frmhours is the value of the Name property of
the subform control, not the value of the SourceObject property of the
subform control.

-Tom.
Microsoft Access MVP


thanks for your reply!

Have double checked the naming and its definately all spelt correctly,
'frmhours' and 'sumofhours' although the can i clarify on where i would find
the CONTROL name?

Thanks again
Welcome.
The error means you did not specify a correct name. So either the name
of the subform control is not "frmhours", or the name of the textbox
with formula is not "sumofhours". I suspect the first: note that this
should be the name of the subform CONTROL, not the name of the form
hosted in it.

-Tom.
Microsoft Access MVP
New member alert, am a bit of a novice with Access, but learning quickly!
[quoted text clipped - 20 lines]
Thanks in advance!!!
 

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