473,785 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upper case and Lower case

75 New Member
Hi fellows

Just a quick question about my database. I have one table in my database which i import it from some other Access db. This table has many fields, such as Initials, Medication name etc....but they are all in different upper case and lower case? Is there a way in Access or VB code so we could change all the current data (in the fields) same Lower case or upper case.

I have this under text box control, and its working fine, but this will effect only on or for new entry on the form. It doesnt effect on the current data in the fields.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Initials_AfterUpdate()
  3.  
  4.     If IsNull(Screen.ActiveControl) = False Then
  5.  
  6.         Screen.ActiveControl = StrConv(Screen.ActiveControl, vbUpperCase)
  7.  
  8.     End If
  9. End Sub
  10.  

any Idea?

Thanks again
Aug 30 '07 #1
15 11555
missinglinq
3,532 Recognized Expert Specialist
You can do the same thing to data already existing by using the same function in an UpDate query.

Linq ;0)>
Aug 30 '07 #2
pukhton
75 New Member
You can do the same thing to data already existing by using the same function in an UpDate query.

Linq ;0)>
I am not sure how to do that.
Aug 30 '07 #3
pukhton
75 New Member
I am not sure how to do that.
I got that thing to work, now my field is in all upper case

Expand|Select|Wrap|Line Numbers
  1.  
  2. UPDATE TABLENAME SET FIELDNAME = UCASE([FIELDNAME]);
  3.  
  4.  
but what If u want to convert something like that.

Linezolid instead of LINEZOLID

Thx.
Aug 31 '07 #4
missinglinq
3,532 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. strconv(YourFieldName,vbProperCase)
will capitalize the first letter of each word in a field.

Expand|Select|Wrap|Line Numbers
  1. strconv(left(YourFieldName,1),vbUpperCase)& right(YourFieldName,len(YourFieldName)-1)
will capitalize only the first letter of the first word in the field.

Linq ;0)>
Aug 31 '07 #5
Jim Doherty
897 Recognized Expert Contributor
Hi fellows

Just a quick question about my database. I have one table in my database which i import it from some other Access db. This table has many fields, such as Initials, Medication name etc....but they are all in different upper case and lower case? Is there a way in Access or VB code so we could change all the current data (in the fields) same Lower case or upper case.

I have this under text box control, and its working fine, but this will effect only on or for new entry on the form. It doesnt effect on the current data in the fields.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Initials_AfterUpdate()
  3.  
  4.     If IsNull(Screen.ActiveControl) = False Then
  5.  
  6.         Screen.ActiveControl = StrConv(Screen.ActiveControl, vbUpperCase)
  7.  
  8.     End If
  9. End Sub
  10.  

any Idea?

Thanks again

Here is one for you to consider it acts on the ON KEYPRSS event of the control so in other words it forces characters to upper case as you type them for your any new records you might put in there

Expand|Select|Wrap|Line Numbers
  1. On Error GoTo Err_Surname_KeyPress
  2.     Dim Character
  3.     Character = Chr(KeyAscii)
  4.     KeyAscii = Asc(UCase(Character))
  5.  
  6. Exit_Surname_KeyPress:
  7.     Exit Sub
  8.  
  9. Err_Surname_KeyPress:
  10.     MsgBox err.Description, vbInformation, "Surname KeyPress Command Cancelled"
  11.     Resume Exit_Surname_KeyPress
Regards

Jim
Aug 31 '07 #6
pukhton
75 New Member
Expand|Select|Wrap|Line Numbers
  1. strconv(YourField,vbProperCase)
will capitalize the first letter of each word in a field.

Expand|Select|Wrap|Line Numbers
  1. strconv(left(YourField,1),vbUpperCase)& right(YourField,len(YourField)-1)
will capitalize only the first letter of the first word in the field.

Linq ;0)>
Thank you for posting, but this will take care of new entry into the field. How would I do it for exsisting record in the table?
Aug 31 '07 #7
Jim Doherty
897 Recognized Expert Contributor
Thank you for posting, but this will take care of new entry into the field. How would I do it for exsisting record in the table?

run an UPDATE query... this is some sample SQL that you can paste into the query SQL window and run as is provided you have a table of the same name and field of the same name and some data to work with

Expand|Select|Wrap|Line Numbers
  1. UPDATE tblcustomerinformation SET tblcustomerinformation.Lastname = UCase([LastName]);
Regards

Jim
Aug 31 '07 #8
pukhton
75 New Member
run an UPDATE query... this is some sample SQL that you can paste into the query SQL window and run as is provided you have a table of the same name and field of the same name and some data to work with

Expand|Select|Wrap|Line Numbers
  1. UPDATE tblcustomerinformation SET tblcustomerinformation.Lastname = UCase([LastName]);
Regards

Jim
I have this already, and all the record are in Ucase. but I want to run a query where I want my data is to be in this format.

"Some Name" currently I have all the information in Ucase.
Aug 31 '07 #9
Jim Doherty
897 Recognized Expert Contributor
I have this already, and all the record are in Ucase. but I want to run a query where I want my data is to be in this format.

"Some Name" currently I have all the information in Ucase.
Are you saying the first letter of EACH word in the same field should be capilized for all of your existing data please clarify
Aug 31 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
8691
by: semovrs | last post by:
Hello, everyone! I would appreciate any input or advice on the following quite simple issue: If I search through a file list using grep -E '.*$' it will not pull files ending in JPG and files ending in png which is fine. However, I have some files ending in jpg (note - lower case) and it will not display them either. Why is that? Am I doing something wrong here and if so - what? It obviously is a regexp issue and not a grep issue because...
10
2938
by: David | last post by:
What can I do to accept either uppercase or lower case " y or n" in the program below.? any help will be appreciated #include <iostream> using namespace std; //class definigtion class Pizza {
22
6448
by: DJ | last post by:
Can someone tell me the library call that converts strings to lower case or retrns a new string that is lower case of the original, thanks im using <string> David
17
11229
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
4
1789
by: Chris | last post by:
Hi, How can I programatically set Upper, Lower and Normal case on a label or text box controls? Thanks
19
26451
by: Eric Lindsay | last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case? I understand that HTML allows either upper or lower case. I also notice that XHTML apparently requires lower case. However I saw some mention that the HTML DOM uses upper case for markup elements. So, should I worry about what this means? I am inclined to go with lower case, for two reasons. Easier to change if I subsequently want to use XHTML.
9
2796
by: B Williams | last post by:
I have written some code that will take in a string and print out the reverse, but I also want it to check for upper and lower case and swap them. Will someone assist me? include <iostream> using std::cout; using std::cin; using std::endl; #include <string>
4
5152
by: silversnake | last post by:
Hi , dose one know the code for checking through a string for upper or lower case char's and reverse them of find ? thanks
5
3086
by: cfmx2008 | last post by:
Hi Guys, I hope you could help me to solve this problem. Here it is: I have a huge table of data. Some data are Lower case and some are upper case. these data could be changed by agents, But I want to keep the case. For example: if data is Lower case and it changed to upper case at the time of change it should be lower case again. I know sounds terrible, but this is the problem. any hints will be appreciated. thanks
2
2909
by: vhsb69 | last post by:
WeIrd - my I,O and P keys tyPe Out In uPPercase, everythIng else Is In lOwercase. Keys are nOt stIckIng. Any One gOt any Ideas? Please helP me I am very cOnfused.
0
10315
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
10147
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...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.