How do I force a Mask to be Capital letters? (1 Viewer)

thorsonb

anonymust
Local time
Yesterday, 19:27
Joined
Sep 7, 2009
Messages
12
Is is possible to have Access convert . switch / replace characters in lower case into uper case?


Eg I have an input Mask for Zip Code (Netherlands styeZ)
the ZIp code over there is as follows

4 digits then 2 characters
eg. 1276 HG , 3873 JY , 8120 PL

I would like the database to automatically switch/convert lowercase text entered into Upper Case
eg. If i were to enter " 6123 kr " as i press enter/ go to the next field on the table to enter data the " kr " are turned into uppercase

How is this possible?
 

DCrake

Remembered
Local time
Today, 06:27
Joined
Jun 8, 2005
Messages
8,632
Use the AfterUpdate event of the control as such

Me.ActiveControl = UCase(Me.ActiveControl)

David
 

thorsonb

anonymust
Local time
Yesterday, 19:27
Joined
Sep 7, 2009
Messages
12
Ok this has me stumped, I Googled it, and it all leads me to Visual Basic...

I'm literally lost, isn't there another way with a Macro perhaps?
 

DCrake

Remembered
Local time
Today, 06:27
Joined
Jun 8, 2005
Messages
8,632
If you look at the properties of rthe textbox that records the post code, there is are properties for before and after update. If you select the one you need (depending on bound or unbound form) and click on the elipses button (3 dots) and select Code builder.

You will be presented with the following

Code:
Private Sub Postcode_BeforeUpdate(Cancel As Integer)


End Sub

Enter the following code between the lines

Code:
   Me.Postcode = UCase(Me.Postcode)


This assumes that the name of the control is called Postcode.

David
 

thorsonb

anonymust
Local time
Yesterday, 19:27
Joined
Sep 7, 2009
Messages
12
Thanks for your help but I found out how to do it, Did some more googleing. :D

My postcode field is to be like this " 1276 HG " but when I enter text in lower case is remains as " 1276 hg "

My input mask was
0000\ LL;0;_

I solved this by using the " > " symbol ( Causes all characters to be converted to uppercase)

My Input mast now is
>0000\ LL;0;_

and it converts all text to upper case :D

Thanks
 

accessprogramer

New member
Local time
Today, 01:27
Joined
Jan 17, 2014
Messages
8
If you look at the properties of rthe textbox that records the post code, there is are properties for before and after update. If you select the one you need (depending on bound or unbound form) and click on the elipses button (3 dots) and select Code builder.

You will be presented with the following

Code:
Private Sub Postcode_BeforeUpdate(Cancel As Integer)


End Sub
Enter the following code between the lines

Code:
   Me.Postcode = UCase(Me.Postcode)
This assumes that the name of the control is called Postcode.

David

This is a newbe question, but I'm stuck! You explained the Postcode, but what is me? The table name?
Thanks!
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Jan 23, 2006
Messages
15,380
You have found a post that is 4+ years old.

Do you really not know what table name means?

Me refers to the current Form you are working with.
Me.Postcode is the Postcode control on the current form.

You really need some introductory tutorials.
Relational Database Principles

Access Fundamentals By Crystal

Input mask samples

If you have more questions, I suggest you try searching the site, and/or creating a new post.
Good luck
 

nanscombe

Registered User.
Local time
Today, 06:27
Joined
Nov 12, 2011
Messages
1,082
This is a newbe question, but I'm stuck! You explained the Postcode, but what is me? The table name?
Thanks!

No, "Me" is not the table name. In this case it is a shorthand way of referring to the current Form.

Instead of having to say Forms("nameOfForm").PostCode you can just say Me.PostCode.
 
Last edited:

Users who are viewing this thread

Top Bottom