By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

Get KeyAscii in control's property

P: n/a
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

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
If KeyAscii = x then Call RunSomeFunction(KeyAscii)
--
Wayne Morgan
MS Access MVP
"laurenq uantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... 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

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.