By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

How to count the total value of selected option boxes

P: 3
Hope someone can help with this problem I have!

On Access, I have a combination of 10 'true/false' buttons that can be selected. Eg. 10 different types of cake.

The user can select any amount of cake.

Each cake has a numeric value.

How can I calculate, using VBA, the total value of chosen cakes?

Currently, I have a very long If statement where I identify whether a button has been pressed by 'Cake1 = True'. Doing it this way, I would have to have an ElseIf statement for every possible combination! Which would be ridiculous!

Is there an easier method I'm overlooking?
Dec 21 '11 #1

✓ answered by Rabbit

You could use a loop to iterate through your 10 controls so you only have to write one IF statement.

Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,324
You could use a loop to iterate through your 10 controls so you only have to write one IF statement.
Dec 21 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.