calculate from a subform

S

sean.home

Hi there

Been tearing my hair out for the past few hours trying to work this
out.
Basically i have a subform called labour, a user can select different
labour options for each job, showing price, which is linked through a
foreign key (job number). What i want to do is calcualte the total
costs for all the labour but only for that job and not the whole
database. I can so far just get one total from the subform by using
=Forms!frm_booking_in!Child55.Form!Price so how do i add up the rest of
the labour?

any help gladly appreciated
 
S

seanlindblad

Right well im sort of a beginner in access, i used to be good but a
four year break has dtotally wipe my brain cells out. lol!

i take it =dsum speaks for itself ("amount") is the price field in my
table...."labortablename" is the table where the price is
held........."job number="&jobnumberfield) is the bit that throws me,
basically the subform where my calculation is run on references the job
number from the main form. How do i go about doing this?
 
J

jleckrone

Sorry I wasn't more clear. Yes, Amount is the name of the field in
your table that you wish to add up. LaborTableName is the name of the
table that holds the prices. The last part is the criteria of what you
are summing. You said that your subform was linked to the main form by
the Job Number, so if I'm understanding what you wrote correctly the
Criteria should read "JobNumber = " & [JobNumber]. JobNumber should be
the name that you called the field. You don't have to refer back and
forth between forms to accomplish what you are trying to do. It sounds
like you want the total on your Main Form. If you put what I have said
into your control (textbox), it should work fine for you.
 

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