473,382 Members | 1,658 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,382 software developers and data experts.

CAPS for Post Code

I would like my Post Code field to be autoformated in CAPS when entered in
the table. How do I do that?
Julian
Aug 13 '06 #1
6 1717
Julian wrote:
I would like my Post Code field to be autoformated in CAPS when entered in
the table. How do I do that?
Julian

In the AfterUpdate event of the PostCode (assumes field's name is
PostCOde) you could enter
Me.PostCode = Ucase(Me.PostCode)

Or in the text field, under the data tab for input mask (press F1 in the
input mask row) enter something like
>aaaaa
The lower case a = Letter or digit (entry optional). The uppercases it.

Aug 13 '06 #2
Julian wrote:
I would like my Post Code field to be autoformated in CAPS when entered in
the table. How do I do that?
It's dangerous and unwise to work directly in the Datasheet View of a
Table or Query so let's suppose you are using a form.

This code, in the form's module is based on the premise that that the
PostCode Field is bound to the txtPostCode Control. Its purpose is to
make Windows think you have the shift key pressed down. (Yes, if you
have Caps Lock on, it will make everything you type lower case).

Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As
Byte) As Long
Private Declare Function SetKeyboardState Lib "user32" (pbKeyState As
Byte) As Long
Private Const VK_CAPITAL = &H14
Dim mAKBState(0 To 255) As Byte

Private Sub txtPostCode_GotFocus()
Dim aKBState(0 To 255) As Byte
GetKeyboardState mAKBState(0)
GetKeyboardState aKBState(0)
aKBState(VK_CAPITAL) = aKBState(VK_CAPITAL) Or 1
SetKeyboardState aKBState(0)
End Sub

Private Sub txtPostCode_LostFocus()
SetKeyboardState mAKBState(0)
End Sub

Aug 13 '06 #3
Hi Julian,

You can use this code in the KeyPress event of the PostCode control:
If (KeyAscii >= 97) And (KeyAscii <= 122) then KeyAscii = KeyAscii - 32
All lowercase characters are - at typing - converted to uppercase.

HBInc.
Julian wrote:
I would like my Post Code field to be autoformated in CAPS when entered in
the table. How do I do that?
Julian
Aug 14 '06 #4
Where about do I find KeyPress event? I am a bit of a newbie.
Julian
Aug 15 '06 #5
or
KeyAscii = Asc(UCase(Chr(KeyAscii)))

--

Terry Kreft
"hbinc" <j.********@hccnet.nlwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi Julian,

You can use this code in the KeyPress event of the PostCode control:
If (KeyAscii >= 97) And (KeyAscii <= 122) then KeyAscii = KeyAscii - 32
All lowercase characters are - at typing - converted to uppercase.

HBInc.
Julian wrote:
I would like my Post Code field to be autoformated in CAPS when entered
in
the table. How do I do that?
Julian

Aug 15 '06 #6
Hi Julian,

I suppose you use a form to enter the PostCode.

Open the form in the develop mode.
Select the PostCode control. In the Proporties of this control you find
the KeyPress event.

HBInc.
Julian wrote:
Where about do I find KeyPress event? I am a bit of a newbie.
Julian
Aug 15 '06 #7

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

Similar topics

18
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not...
4
by: Peter D | last post by:
I have a second hand bar code reader (keyboard wedge) en i can read the bar codes but after every scan he turns my caps lock on. (GRRRRRR). I search a code to turn my caps lock off or can anyone...
20
by: Malcolm | last post by:
Use all lower case for ansi c functions, and Capitalise For Platform-Specific. If you call something with caps, then your function name requires caps itself.
3
by: Mike L | last post by:
How do I turn Caps Lock on, when my form opens?
1
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if...
2
by: Gary | last post by:
Hello, I am trying to force the formatting of a Post Code field on my form, and require that all post codes are processed as FULL CAPS. I do not want to force the user to type on all caps, so...
9
by: trondhuso | last post by:
Hi, I have a solution that - at time of writing - has to use tables to render a list of database-results. My challenge though is that we have used iframes and such to render the different lists...
1
by: cmrhema | last post by:
Hi, Two questions 1. In windows application if we put on the below code, it will identify whether caps lock is on or not if (TextBox.IsKeyLocked(Keys.CapsLock)) { ...
18
by: DanicaDear | last post by:
I want to use all caps in a database. I desire to show all caps AS YOU TYPE regardless of how the keyboard/caps lock is set. I tried to format my form field with an on-click event…and this is the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.