hi, my command button sets its function to get the sum of my daily income. And when i click it again the sum will become double (EVERY CLICK) so i want to my command button to WORK by only 1 CLICK.

example
10 + 10 = 20
when i click again my command button the
answer in the textbox becomes 40 and 60 and 80 and 100 ...

i want to limit it to 1 so that i will stay only on 20.

it is possible? help me please

Recommended Answers

All 2 Replies

You could do it in several ways. One simple way is to just disable the button so it can't be clicked again. Another way is to set a value in the "Tag" property of the button, then check it every time and only allow adding if the Tag has no value. Even a third way is to set a module-level variable, then do the same type of test. You could probably get creative and think of some other ways, such as hidden controls...but you probably get the point by now. Good luck, and Happy Coding!

commented: agree +13

Show me the code you have where it calculates the sum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.