Add 1 to field value on form

  • Thread starter Melanie S. via AccessMonster.com
  • Start date
M

Melanie S. via AccessMonster.com

I have a lengthstay field (from tblGuests) on a form, and I want to make a
button that will add '1' to the lengthstay field value (value automatically
change after clicking on button), what code do I need to put in the OnClick
event?
 
K

Ken Snell [MVP]

The following VBA code will do this; substitute the real names for the
generic ones I've used. Select Event Procedure in the box next to the On
Click property, then click the three-dot button at far right to add the
code:

Private Sub ButtonName_Click()
Me.TextBoxName.Value = Me.TextBoxName.Value + 1
End Sub
 
M

Melanie S. via AccessMonster.com

yay! thank you! =)

The following VBA code will do this; substitute the real names for the
generic ones I've used. Select Event Procedure in the box next to the On
Click property, then click the three-dot button at far right to add the
code:

Private Sub ButtonName_Click()
Me.TextBoxName.Value = Me.TextBoxName.Value + 1
End Sub
 
Top