![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 the 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 |
#3
| |||
| |||
|
|
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 the 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 |
#4
| |||
| |||
|
|
If RunSomeOtherFunction is declared as shown below in a module then you can run it from the immediate window like this ?RunSomeOtherFunction(Asc("A")) Where Asc is a function which returns the ASCII value of the first character in the string passed to it. -- Terry Kreft MVP Microsoft Access "laurenq uantrell" <laurenquantrell (AT) hotmail (DOT) com> wrote in message news:1105020619.117652.263760 (AT) c13g2000cwb (DOT) googlegroups.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 the 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 |
#5
| |||
| |||
|
|
Terry, Thanks for the reply. I was hoping there is a way to crack what seems to be built-in functions in Access that expose the KeyAscii value and other values that reveal themselves only when exposed through the event procedure. lq Terry Kreft wrote: If RunSomeOtherFunction is declared as shown below in a module then you can run it from the immediate window like this ?RunSomeOtherFunction(Asc("A")) Where Asc is a function which returns the ASCII value of the first character in the string passed to it. -- Terry Kreft MVP Microsoft Access "laurenq uantrell" <laurenquantrell (AT) hotmail (DOT) com> wrote in message news:1105020619.117652.263760 (AT) c13g2000cwb (DOT) googlegroups.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 the 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |