thatjayguy
Technical User
I am building a simple calculator program to use when working with feet and inches and I'm having trouble with sending a cooresponding value to the UserForm_KeyPress event.
This is what I have so far:
Private Sub cmd0_Click()
UserForm_KeyPress (48)'this is where it is failing
End Sub
Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Then
txtEntry.Text = txtEntry.Text & Chr(KeyAscii)
End If
If KeyAscii = vbKeyBack Then
cmdDel_Click
End If
End Sub
What do I need to change to correctly call the UserForm_KeyPress event?
Thanks in advance for you assistance.
This is what I have so far:
Private Sub cmd0_Click()
UserForm_KeyPress (48)'this is where it is failing
End Sub
Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Then
txtEntry.Text = txtEntry.Text & Chr(KeyAscii)
End If
If KeyAscii = vbKeyBack Then
cmdDel_Click
End If
End Sub
What do I need to change to correctly call the UserForm_KeyPress event?
Thanks in advance for you assistance.