Need help in creating number keypad for a touch screen program

daviddavefua

New member
Local time
Today, 14:44
Joined
Nov 1, 2012
Messages
5
Hi! I need help in creating a button for a period (.) in a numbers keypad. I was able to get from codeproject.com a sample code for the numbers 1 to 9 and 0. But I could not create a button to encode a period for the centavos.

Thanks
 
Thanks.

But how do I include this in this:

Private Sub Key_Period_Click()
TypeAlphaNum "."
End Sub
 
So far this is what I have copied from projectcode.com. I modified the buttons but I've copied everything. The thing is i need to enter the centavos also and the period or dot is not included. This is what I added. Please help. Thanks

Option Compare Database


Private Function TypeAlphaNum(strKey As String) As String
Screen.PreviousControl.SetFocus
Me.Controls(Screen.ActiveControl.Name).SelStart = Nz(Len(Me.Controls(Screen.ActiveControl.Name)), 0)
Me.Controls(Screen.ActiveControl.Name).SelLength = 0
Me.Controls(Screen.ActiveControl.Name).Value = Me.Controls(Screen.ActiveControl.Name).Value & strKey
End Function

Private Sub Key_0_Click()
TypeAlphaNum "0"
End Sub

Private Sub Key_1_Click()
TypeAlphaNum "1"
End Sub

Private Sub Key_2_Click()
TypeAlphaNum "2"
End Sub

Private Sub Key_3_Click()
TypeAlphaNum "3"
End Sub

Private Sub Key_4_Click()
TypeAlphaNum "4"
End Sub

Private Sub Key_5_Click()
TypeAlphaNum "5"
End Sub

Private Sub Key_6_Click()
TypeAlphaNum "6"
End Sub

Private Sub Key_7_Click()
TypeAlphaNum "7"
End Sub

Private Sub Key_8_Click()
TypeAlphaNum "8"
End Sub

Private Sub Key_9_Click()
TypeAlphaNum "9"
End Sub

Private Sub Key_Backspace_Click()
Screen.PreviousControl.SetFocus
Me.Controls(Screen.ActiveControl.Name).SelStart = Nz(Len(Me.Controls(Screen.ActiveControl.Name)), 0)
Me.Controls(Screen.ActiveControl.Name).SelLength = 0
If Me.Controls(Screen.ActiveControl.Name).Value > 0 Then
Me.Controls(Screen.ActiveControl.Name).Value = Left(Me.Controls(Screen.ActiveControl.Name).Value, Len(Me.Controls(Screen.ActiveControl.Name)) - 1)
Else
End If
End Sub

Private Sub Key_Period_Click()

TypeAlphaNum "."
End Sub
 

Users who are viewing this thread

Back
Top Bottom