dbTalk Databases Forums  

Get KeyAscii in control's property

comp.databases.ms-access comp.databases.ms-access


Discuss Get KeyAscii in control's property in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
laurenq uantrell
 
Posts: n/a

Default Get KeyAscii in control's property - 01-06-2005 , 08:15 AM






In a field's OnKeyPress properties I can execute code that reveals the
Ascii key that is pressed:

On Key Press: [Event Procedure]

Private Sub FieldName_KeyPress(KeyAscii As Integer)
Dim x as Integer
If KeyAscii = x then Call RunSomeFunction
End Sub

Is it possible to do the same if I call a function from the property
window of the control:

On Key Press: =RunSomeOtherFunction(???KeyAscii???)

Function RunSomeOtherFunction(KeyAscii As Integer)
Dim x as Integer
If KeyAscii = x then
call RunSomeExcitingCode
End If
End Function


Reply With Quote
  #2  
Old   
Wayne Morgan
 
Posts: n/a

Default Re: Get KeyAscii in control's property - 01-07-2005 , 09:29 AM






Call the function from within the event as you indicate in your first
example. You can pass the key code in that call if you are wanting to pass
it.

Quote:
If KeyAscii = x then Call RunSomeFunction(KeyAscii)
--
Wayne Morgan
MS Access MVP


"laurenq uantrell" <laurenquantrell (AT) hotmail (DOT) com> wrote

Quote:
In a field's OnKeyPress properties I can execute code that reveals the
Ascii key that is pressed:

On Key Press: [Event Procedure]

Private Sub FieldName_KeyPress(KeyAscii As Integer)
Dim x as Integer
If KeyAscii = x then Call RunSomeFunction
End Sub

Is it possible to do the same if I call a function from the property
window of the control:

On Key Press: =RunSomeOtherFunction(???KeyAscii???)

Function RunSomeOtherFunction(KeyAscii As Integer)
Dim x as Integer
If KeyAscii = x then
call RunSomeExcitingCode
End If
End Function




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.