Hello, I would like to call the Keypress event from within another block of code. For example:
Public Sub Test()
Call Form_KeyPress("A")
End Sub
Thanks for any info!!
Printable View
Hello, I would like to call the Keypress event from within another block of code. For example:
Public Sub Test()
Call Form_KeyPress("A")
End Sub
Thanks for any info!!
Actually, as I'm sure you know, you can't. Not like that anyway. What you need to do is create a generic sub that handles both (calls from Form_KeyPress and your other sub). For example:
Private Sub Form_KeyPress(KeyAscii As Integer)
GenericSub(KeyAscii)
End Sub
Sub AnotherSub()
GenericSub(KeyThatYouWantFired)
End Sub
Sub GenericSub(KeyThatYouWantFired as Integer)
'do whatever you are trying to do here
'such as setting properties or calling
'other subs
End Sub
-Adam
Yes, you can. But you can't pass the actual letter but rather an ASCII number for that letter:
Call Form_KeyPress(Asc("A"))
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
Thanks for your help guys!! Unfortunatly neither of those solutions solved my problem. I'm having difficulties with MSComm and this was an attempt to fix them. Please check out my question about MSComm firing.
Thanks!!
Phil