On Mar 20, 9:25 am, "brino" <bdsolutions2...@yahoo.com.auwrote:
hi all !
i have a database working on a touch screen.
on one of the forms i would like to place some buttons with all
numbers so you can enter a numeric value in without using the
keyboard. ie. "1","2","3","4","5","6","7","8","9","0"
how can i set up buttons on the form so that when you touch the button
on the touch screen it enters that number into the data field ?
im not sure if this is possible or not with Access ??
any ideas would be appreciated .... thanks!
brino
Hi Brino,
Create the command buttons and name them something like cmd1, cmd2
etc.
Create a text box called something like myTextBox.
In the "On Click" event of cmd1, put the following code:
Private Sub cmd1_Click()
Dim txtVal As String
Dim newTxtVal As String
If IsNull(Me.myTextBox.Value) Then
Me.myTextBox.Value = 1
Else
txtVal= Me.myTextBox.Value
newTxtVal = winVal & 1
Me.myTextBox.Value = newTxtVal
End If
End Sub
Continue this for the rest of the buttons, changing the number "1" in
the code to "2" and so on for all the buttons.
This just concatenates the number of the button you have just clicked
to the end of the string in the text box.
Hope this helps a bit,
David