Hi guys,
I have this calculator software working on my computer. It is working fine. However, when I copy this project and paste it at another computer, it has this error.
This error occur whenever I try to type numbers using my keyboard. I don't know whats wrong. Here is my code for keypress.
How to solve this problem?Code:Private Sub Form_KeyPress(KeyAscii As Integer) Dim char As String char = Chr$(KeyAscii) KeyAscii = Asc(char) If (KeyAscii = 8) Then If (Len(text1.Text) > 1) Then text1.Text = Left(text1.Text, Len(text1.Text) - 1) Else text1.Text = "0" End If End If If (KeyAscii = 46) Then Me.shiftPos End If If (KeyAscii > 46) And (KeyAscii < 58) Then If (text1.Text = 0) Then If (Shift = True) Then text1.Text = "0." & Chr(KeyAscii) Shift = False Else text1.Text = Chr(KeyAscii) End If Else text1.Text = text1.Text & Chr(KeyAscii) End If End If End Sub




Reply With Quote