Applecore Pages on Microsoft Access

Increasing/Decreasing a Text Box's value using Left/Right Mouse Clicks

If you wish to be able to use a mouse click to increase/decrease a numeric value in a text box, then you will firstly need to turn off the Form's Shortcut Menu, which are also activated when the user right clicks on a control.

Then you will need to have some code in the MouseDown event for the Text Box:

Private Sub UnitsInStock_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If IsNumeric(Me!UnitsInStock) Then
        Select Case Button
            Case 1 ' Left mouse click
                Me!UnitsInStock = Me!UnitsInStock + 1
            Case 2 ' Right mouse click
                Me!UnitsInStock = Me!UnitsInStock - 1
        End Select
    End If
End Sub

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 14:54:06