473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

KeyAscii in property window

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

Nov 13 '05 #1
4 5402
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" <la*************@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.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 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

Nov 13 '05 #2
laurenq uantrell wrote:
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


Doubtful. KeyAscii is an argument passed to the OnKeyPress event by
Access.
Nov 13 '05 #3
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" <la*************@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.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 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


Nov 13 '05 #4
Ah, right, I went back and re-read your OP I missed the property page part.

No, it's not possible.

Think of the property page as being a higher level than the procedure, at
the property page level you can choose to
a) run a specific function
b) build an expression
c) execute the appropriate event for the control

These are three distinct choices, the KeyAscii value of the key pressed is
only exposed in the event.
--
Terry Kreft
MVP Microsoft Access
"laurenq uantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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" <la*************@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.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 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

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: margetts | last post by:
Hey there, what i want to do is have a text field that can only accept numbers, full stops and the backspace key. I currently have the below code to accept only numbers, but no full stops or...
3
by: Job Lot | last post by:
I have added a ProgressBar control to StatusBar control and created a custom property as below, to show the properties of the ProgressBar in Property Window of StatusBar. <Browsable(True)> _...
1
by: laurenq uantrell | last post by:
In a field's OnKeyPress properties I can execute code that reveals the Ascii key that is pressed: On Key Press: Private Sub FieldName_KeyPress(KeyAscii As Integer) Dim x as Integer If...
2
by: ahmedazzam | last post by:
I need to know Keyascii for different keys
4
by: HelloWorldHelloWorldHello | last post by:
What i want to know is What is the KeyAscii of " "Tab" key" ?.
1
by: HelloWorldHelloWorldHello | last post by:
Can Anyone Tell Me How to direct KeyAscii with using CommandButton Only.?
1
by: HelloWorldHelloWorldHello | last post by:
How to use KeyAscii without any KeyPress(text1_Keypress).? But CommandButton can direct the KeyAscii only.
1
by: Asad Asad | last post by:
Please tell me what is the KeyAscii value of Window Key
3
by: shona | last post by:
Hi, I done program in that i don't want backspace button active in that case i done coading it is working fine in textbox & now i want to use in richtextbox but how? following is my code ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.