Working with forms and sub forms

hattrix86

New Member
Joined
Jul 30, 2007
Messages
3
I'm having difficulty with this following problem:

I have a form consisting of a Main form, and several sub forms. There is a box in the main form which needs to display a number. This number is a sum of numbers from the various records in the sub form. However, it is more complicated because the sum is only made up of numbers that fit a certain criteria.

So essentially i have to take info from a sub form, weed out the ones that don't fit the criteria, and then add up the numbers left, and display it on the main form.

Helpppp please.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

NumbersMax

Board Regular
Joined
Jun 19, 2007
Messages
200
I would try writing a query based on the same object (whether table or query) as the subform. Enter the criteria directly to the query or have the criteria come from a field in the form so that you can change it as the need arises. Use the Sum feature from the totals row of the query grid to sum the filtered contents.

Make the newly created query (specifically the summed data field) the control source for the form field that is to display the summed data.

Max
 

Forum statistics

Threads
1,181,412
Messages
5,929,784
Members
436,692
Latest member
ModestMuse

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top