On Click add 1 to bound text box

Trevor Howard

Registered User.
Local time
Today, 16:22
Joined
Aug 29, 2002
Messages
64
I have a print button on a form, when the button is clicked (to print report) I would like a text field to automatically show 1, if pressed again in future would show 2 and so on. Users have asked for this so they know if someone has printed the report.

Your help would be great.

Thanks
Trevor
 
Hello
The below code would be one way: Put this under a command button named cmdAdd1 click event. This will increment a value in a text box named txtField1
Regards
Mark

'
Private Sub cmdAddOne_Click()
Dim x As Integer
x = Nz(txtField1)
x = x + 1
txtField1.SetFocus
txtField1 = x
End Sub
 
Hello Mark,

That worked a dream, Much appreciated.
Thank You!

Regards,
Trevor
 

Users who are viewing this thread

Back
Top Bottom