Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

counting field values

Forum home » Delegate support and help forum » Microsoft Access Training and help » Counting field values

Counting field values

ResolvedVersion 2003

Daiga has attended:
Access Intermediate course

Counting field values

I am trying to design my database and let's say I have 8 number fileds (each decimal double) to enter the number of vaccines administered to people in different age groups (8 categories) on my form. And I want to create settings that would allow user to enter only correct data - in this case the sum of those eight fileds should match and fit the total number, which is another number field with called ' total number of vaccines administered'. How to set it up? Is it something to do in table properties? Is it validation rule or is it expression builder where I do the settings? I am looking forward for your help.
Thanks in advance

RE: counting field values

Hi Daiga

Thanks for your question

Can you clarify for me how you want this to work?

Do you want the user to enter the 8 numbers, and after the final number is entered Access checks to see if the sum of the numbers matches a figure in the totals column?

If this is the case, then what do you want to happen if the numbers don't match?

Thanks

Stephen

RE: counting field values

Yes, there should be 8 number fileds on the form, but I would like to have another one - N/A (when data is not provided). If data are provided for only some age ranges, I should assume the rest are zero. N/A only to be used if no data provided at all (so should be left blank the field of totals aswell). Yes, I think that would be the best - that Access checks whether the totals column matches with sum after all fields antered. If they don't match I would like to have the message popping up that the sum of hose 8 fields should be equal to totals. Perhaps there is a way to set up each field that it is not greater than total field. .....

Counting field values

Yes, there should be 8 number fileds on the form, but I would like to have another one - N/A (when data is not provided). If data are provided for only some age ranges, I should assume the rest are zero. N/A only to be used if no data provided at all (so should be left blank the field of totals aswell). Yes, I think that would be the best - that Access checks whether the totals column matches with sum after all fields antered. If they don't match I would like to have the message popping up that the sum of hose 8 fields should be equal to totals. Perhaps there is a way to set up each field that it is not greater than total field. .....

Access tip:

Open A Combo Box Automatically

This is helpful if users need to enter large amounts of data. There are two ways to open ComboBoxes when they get the focus by using the tab keys.

When the ComboBox gets focus:

Press Alt + Down Arrow on the keyboard

For it to happen automatically, needs a bit of coding:

1. Add a combo box and a text box control to the form
2. Set the combo box's On Got Focus property to the following event procedure:

Private Sub ComboBoxName _GotFocus()

Me!ComboBoxName.Dropdown

End Sub


3. Open your form in Form View and use the TAB key to make sure it works.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.