473,785 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1737
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.PostCo de)

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 GetKeyboardStat e Lib "user32" (pbKeyState As
Byte) As Long
Private Declare Function SetKeyboardStat e Lib "user32" (pbKeyState As
Byte) As Long
Private Const VK_CAPITAL = &H14
Dim mAKBState(0 To 255) As Byte

Private Sub txtPostCode_Got Focus()
Dim aKBState(0 To 255) As Byte
GetKeyboardStat e mAKBState(0)
GetKeyboardStat e aKBState(0)
aKBState(VK_CAP ITAL) = aKBState(VK_CAP ITAL) Or 1
SetKeyboardStat e aKBState(0)
End Sub

Private Sub txtPostCode_Los tFocus()
SetKeyboardStat e 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(K eyAscii)))

--

Terry Kreft
"hbinc" <j.********@hcc net.nlwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.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
4932
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 help. I have seen some example that looks at the characters entered in an input field to determine if the caps lock is on, but I was wondering if something is possible that is a bit more immediate to report the caps
4
6658
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 tell me why (the hell)it happens that way.
20
2014
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
6648
by: Mike L | last post by:
How do I turn Caps Lock on, when my form opens?
1
15672
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 someone is interested, let me know and I will send you the codes). Once we know if the stat of Num Lock/ Caps Lock is not what we desired, we just send the Num Lock / Caps Lock key to change the stat. From most of
2
9569
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 would like it if onBlur, or onSubmit, that for example "im1 2ez" becomes "IM1 2EZ". Any help appreciated!! Gary.
9
1575
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 on this page, and now - for some reason - the table has become to wide. I am looking at the code and trying to change width using css, but without much luck. I see that in some of the data there are Caps-only text, and I am now wondering if...
1
3161
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)) { MessageBox.Show("caps lock on"); }
18
15662
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 code I am trying to use (which I found on the internet while researching this). Private Sub ChangetoUpperCase(KeyAscii As Integer) If KeyAscii >= 97 And KeyAscii <= 122 Then KeyAscii = (KeyAscii - 32) End If End Sub I have tried to put this...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10357
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10101
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.