|
-
Dec 4th, 1999, 12:29 PM
#1
Thread Starter
Addicted Member
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!!
-
Dec 4th, 1999, 02:19 PM
#2
New Member
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
-
Dec 4th, 1999, 11:43 PM
#3
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
-
Dec 5th, 1999, 02:18 AM
#4
Thread Starter
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|