How do I create a manual counter on a access form?


G

Guest

Hi,

I am looking to put a manual counter on a form that a user can click an up
button to add one to the number or click a down button to subtract one form
the current number. Can anyone help me with this?

Thanks!
 
Ad

Advertisements

R

Rick B

just add "on click" code to the buttons.

In the up button...

Me.SomeFieldName = SomeFieldName +1


Rick B
 
P

Paul Overway

Place a text box on the form.

In the Click event for the Up button

Me.txtYourControlNameHere = Me.txtYourControlNameHere + 1

In the Click event for the Down button

Me.txtYourControlNameHere = Me.txtYourControlNameHere - 1
 
Joined
Nov 26, 2014
Messages
2
Reaction score
0
***I tried using the Code but it does not work for me Access 2010 :-(.

is the Me.txtYourControlNameHere [the text box for both parts of the code?

Me.txtYourControlNameHere = Me.txtYourControlNameHere + 1

I added the code to the on click event and nothing happens....

Thank you
Jose
 
Ad

Advertisements

Joined
Nov 26, 2014
Messages
2
Reaction score
0
Nevermind I found this works for Access 2010:

In the Click Event insert this code for the Up (+) Button:
Me.txtAmountcompleted.Value = Me.txtAmountcompleted.Value + 1

[and]

In the Click Event insert this code for the Up (-) Button:
Me.txtAmountcompleted.Value = Me.txtAmountcompleted.Value - 1

NOTE: In order for the code to work the Textbox in question must have a value of 0 (zero) already inserted on Form Load; that way Access knows to count up from 0 (zero).
 

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