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

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
just add "on click" code to the buttons.

In the up button...

Me.SomeFieldName = SomeFieldName +1


Rick B
 
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
 
***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
 
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).
 
Back
Top