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

  • Follow


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!!!

0
Reply hermondo 1/14/2010 10:56:11 AM

On Thu, 14 Jan 2010 10:56:11 GMT, "hermondo" <u57484@uwe> wrote:

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!
>
>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!!!
0
Reply Tom 1/14/2010 2:07:52 PM


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

Tom van Stiphout wrote:
>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!!!

0
Reply hermondo 1/14/2010 5:00:04 PM

On Jan 14, 4:56=A0am, "hermondo" <u57484@uwe> wrote:
> 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 th=
e
> 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 whic=
h 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 =A0 ""=3DSum([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
>
> =3Dfrmhours.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

0
Reply Piet 1/15/2010 12:12:07 AM

On Thu, 14 Jan 2010 17:00:04 GMT, "hermondo" <u57484@uwe> wrote:

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
>
>Tom van Stiphout wrote:
>>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!!!
0
Reply Tom 1/15/2010 2:18:31 AM

4 Replies
182 Views

(page loaded in 0.061 seconds)

Similiar Articles:












7/24/2012 3:16:41 AM


Reply: