command buttons

C

Chaltain

i want a text box to count the number of times a certain command button has
been pressed?
 
A

Al Campagna

Chaltain,
If you mean... the total from day to day, you'll need to create a table
to hold that value.
On your button's OnClick event, you'll have to run an Update query
against that table, to increment the
table value by 1 each time the button is clicked.
A text control on your form can do a calculated DLookup of that table
value, to always show the current table value.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

John W. Vinson

i want a text box to count the number of times a certain command button has
been pressed?

If you don't mind the count starting over every time you open the form, just
use an unbound textbox named (say) txtClickCount. Put code in the button's
click event like

Me!txtClickCount = NZ(Me!txtClickCount) + 1

If you need to keep track over a longer term, use a table as Al suggests.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top