Adding two records on continuous form

donsi

Registered User.
Local time
Yesterday, 23:08
Joined
Sep 1, 2016
Messages
73
Is it possible to add two fields on separate records on the continuous form?

I have a sales amount for each month displayed on the form. I would like to sum only two month at at time and display that on unbound txtbox, how can this be done?

EX:

1 Jan $5000
2 Feb $6000 --- |$11000|
3 Mar $5500
4 Apr $4500 ----|$10000|


Thank you
 
You could do this with an aggregate query. Please refer to the attached database for this discussion.

Before you create an aggregate query you will need to translate the individual months into a grouping. If you look at the MonthGroups table in the attached database you will see that it maps the months to groups, e.g., Jan and Feb are both mapped to a group I call JanFeb. This table is related to the Sales base on the month so when the tables are joined the occurrences of Jan and Feb are both JanFeb in the output. So the aggregate query groups on that and sums the amounts.

If the Sales table in the example had years of data all of the Jan and Feb amounts would be sum together which is probably not want you want. You would just need to extend the key of this grouping to include the years.

Then you can make this aggregate query the record source of the the continuous form as done in the attached database

PS: In your question you wanted to use an unbound textbox. The reason why I didn't address this is because a unbound textbox in a continuous form can only have a single value for all of the records. This wouldn't work for your problem.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom