subtotals for selected cells (1 Viewer)

bmhuettinger

Registered User.
Local time
Yesterday, 16:40
Joined
Jul 28, 2017
Messages
59
Hi all!
I'm trying to convert a well-used (and well-loved) Excel spreadsheet to a better-suited Access form and so far, so good. There is one feature from Excel, however, that I can't seem to duplicate in Access, and it's an important feature for my co-worker. He's become very dependent upon selecting a few cells in his worksheet, and quickly referencing the subtotals below.
The form is a split-view, so what I'd like to do is a create a form control box that displays the subtotals of a particular column (field) based on the selected cells (or rows, as selecting specific cells is difficult in Access).
I've managed to find a couple of boards that offer code to reference selected rows, but I don't how how to begin to use the code to create a subtotal field. Looking for help.
(note: - there are 3 fields with the data I want to subtotal, one field at a time. Form is [DailyReviewForm]; Fields are [100] or [105] or [110]
Thanks much!
Brandi
 

isladogs

MVP / VIP
Local time
Today, 00:40
Joined
Jan 14, 2017
Messages
18,247
I would suggest you do the following

Add a Boolean (yes/no) field to the form record source with a default value =0.
Display this field on the datasheet part of the form as a checkbox

Individual records can then be selected by ticking the checkboxes required

Add a command button or combo box with code to filter for records where Boolean field is true.

In the form footer section add text boxes to contain the subtotals of the required columns.
In each, use something like
Code:
=SUM([FieldName])

NOTE
1. You'll also need code to deselect records and remove the filter

2. Access split forms don't always behave 'nicely' when modified.
If you have problems doing this, replace with an emulated split form.
See https://www.access-programmers.co.uk/forums/showthread.php?t=294421
 
Last edited:

bmhuettinger

Registered User.
Local time
Yesterday, 16:40
Joined
Jul 28, 2017
Messages
59
Perfect! Super simple solution. Thanks!
 

isladogs

MVP / VIP
Local time
Today, 00:40
Joined
Jan 14, 2017
Messages
18,247
You're welcome.

Think I've also answered at least one of your posts (as Brandi) on another forum (UA?)
 

Users who are viewing this thread

Top Bottom