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

Capitalization

How do i check if the first character in a textbox is capitalized or not?
Oct 20 '06 #1
2 1481
scripto
143 100+
dim num as int

on error resume next ' just in case the first character is a number

num = ASC(left(text1.text, 1))
if num >= 65 and num <= 90 then
' it is capitalized
' do something
else
'
end if
Oct 20 '06 #2
Killer42
8,435 Expert 8TB
dim num as int

on error resume next ' just in case the first character is a number

num = ASC(left(text1.text, 1))
if num >= 65 and num <= 90 then
' it is capitalized
' do something
else
'
end if
It's more fun to have more than one way to do things. :)
So, another alternative would be...
Expand|Select|Wrap|Line Numbers
  1. Select Case Left$(Text1.Text,1)
  2.   Case "A" to "Z"
  3.     ' It is capitalised (Australian spelling)
  4.   Case Else
  5.     ' It isn't.
  6. End Select
I just like the Select statement because the "TO" clause allows you to avoid complicating things with ANDs and ORs. It's just a matter of personal preference.
Oct 21 '06 #3

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

Similar topics

5
by: icrash2 | last post by:
Hi, I'm using PHP to submit form input to MySQL and need a way to capitalize the first character for certain fields. Does anyone know of some way to achieve this? Much appreciated
0
by: Agoston Bejo | last post by:
Tools / Options / Text Editor / HTML/XML / Format / Capitalization Usually I use Tags: Uppercase; Attributes: Uppercase but now I edit XML pages and I set them both to "As entered". However,...
8
by: Ray | last post by:
Hello guys, OK, I've been reading some more about Python. There are some things about Python exception that I haven't been able to grasp: 1. This is a small thing, but why is object spelled...
6
by: Corepaul | last post by:
I am new to Access 2000. My operating system is Windows 2000. In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time...
1
by: AA Arens | last post by:
To have the first character of a fiels capitalized AfterUppdate, I used the following script: Me!City = UCase$(Left$(Me!City, 1)) + Mid$(Me!City, 2) UCase (Left(Me!City, 1)) + Mid(Me!City, 2) ...
5
by: Aaron | last post by:
How do you detect a string that is all capitalized? ie. string s = "MY NAME IS"; return true; string s = "My Name is"; return false;
5
by: Bruce W.1 | last post by:
Looking at the html produced by Visual Studio I see a mixed bag of tag capitalization. For example there's <HEAD> and <body>. Then there's <form and <TABLE>. Is there some logic behind the mixed...
3
by: Tim | last post by:
I just bought VS .Net, and am getting up to speed. One thing I can't find, though, is how to get the editor to automatically capitalize keywords (Public, As, Imports, etc.), the way the VB 6.0...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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,...

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.