Save Record To Update Subform

  • Thread starter hobbit2612 via AccessMonster.com
  • Start date
H

hobbit2612 via AccessMonster.com

Hi I wonder if someone can help me please.

I am using a form to show Work Areas and a linked subform for the jobs
attached to that Work Area.

One of the fields on the subform is called Cost which I need to total and
show back on the main form, but, only if a tick box within the record is not
ticked.

Normally I would add a hidden text box to the subform footer that sums up the
cost, then create another text box on the main form linking to that hidden
text box.

However, because there is a certain criteria as to what is and isn't totalled,
i.e. the tick box, I can't do this.

I thought I had come up with a solution by creating another subform taking
the data directly from the table where the jobs are stored, enabling me to to
sum only the jobs that don't have the ticked box selected. I have then added
a text box to the main form linking to the sum of cost from the new subform.

However everytime I add a new job, I can't get this to update to the new
subform, and hence the text box unless I close the form.

Could someone tell me please, is there a way to get around this?

Many thanks and regards

Chris
 
M

Marshall Barton

hobbit2612 said:
I am using a form to show Work Areas and a linked subform for the jobs
attached to that Work Area.

One of the fields on the subform is called Cost which I need to total and
show back on the main form, but, only if a tick box within the record is not
ticked.

Normally I would add a hidden text box to the subform footer that sums up the
cost, then create another text box on the main form linking to that hidden
text box.

However, because there is a certain criteria as to what is and isn't totalled,
i.e. the tick box, I can't do this.

I thought I had come up with a solution by creating another subform taking
the data directly from the table where the jobs are stored, enabling me to to
sum only the jobs that don't have the ticked box selected. I have then added
a text box to the main form linking to the sum of cost from the new subform.

However everytime I add a new job, I can't get this to update to the new
subform, and hence the text box unless I close the form.


If the check box is in the subform records, use this kind of
expression in the subform footer:
=Sum(IIf(tickfield, costfield, 0))
 
H

hobbit2612 via AccessMonster.com

Marshall,

This is great, the only slight problem is that it is counting the ones that
are ticked, but I would like to count the ones that aren't ticked.

Any ideas please?

Kind Regards

Chris
Marshall said:
I am using a form to show Work Areas and a linked subform for the jobs
attached to that Work Area.
[quoted text clipped - 17 lines]
However everytime I add a new job, I can't get this to update to the new
subform, and hence the text box unless I close the form.

If the check box is in the subform records, use this kind of
expression in the subform footer:
=Sum(IIf(tickfield, costfield, 0))
 
M

Marshall Barton

In that case try using:
=Sum(IIf(Not tickfield, costfield, 0))
--
Marsh
MVP [MS Access]

This is great, the only slight problem is that it is counting the ones that
are ticked, but I would like to count the ones that aren't ticked.

Marshall said:
I am using a form to show Work Areas and a linked subform for the jobs
attached to that Work Area.
[quoted text clipped - 17 lines]
However everytime I add a new job, I can't get this to update to the new
subform, and hence the text box unless I close the form.

If the check box is in the subform records, use this kind of
expression in the subform footer:
=Sum(IIf(tickfield, costfield, 0))
 
H

hobbit2612 via AccessMonster.com

Marshall,

That works a treat!

Thank you so much for your time and help, this problem had been annoying me
for a few days and it was getting tiresome.

Many thanks and kind regards

Chris

Marshall said:
In that case try using:
=Sum(IIf(Not tickfield, costfield, 0))
This is great, the only slight problem is that it is counting the ones that
are ticked, but I would like to count the ones that aren't ticked.
[quoted text clipped - 8 lines]
 

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