command buttons

  • Thread starter Thread starter Chaltain
  • Start date Start date
C

Chaltain

i want a text box to count the number of times a certain command button has
been pressed?
 
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."
 
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.
 
Back
Top