hi all
suggest me, how to give first letter of my textfield to caps.
eg. if a person enters a name in the namefield. it should automatically turns to caps
7 2159 PEB 1,418
Expert 1GB
Hi,
Possibly you use a form to enter information in your text field!
If this is the case in the text field properties choose event procedure and type the following code:
Me!TextField=Ucase(left(Me!TextField,1))+mid(Me!Te xtField,2, len(Me!TextField)-1)
You need only to change TextField with the name of yourrespective field name
Copy/Paste it from the name of the procedure that should be:
Sub TextField_AfterUpdate()
NeoPa 32,556
Expert Mod 16PB
Assuming your TextBox is named 'namefield' then try :- - Private Sub namefield_AfterUpdate()
-
namefield = UCase(Left(namefield, 1)) & LCase(Mid(namefield, 2))
-
End Sub
Excel has a function Proper() which does this but for all words in string, but it's not in Access library.
Actually, Access does have a proper function, although it is a cconstant.
Private Sub tbName_AfterUpdate()
'Routine is run after tbName text box is updated.
On Error GoTo Err_tbName_AfterUpdate
tbName = Trim(tbName) 'remove preceeding spaces
tbName = StrConv(tbName, vbProperCase) 'convert to proper case
Exit_tbName_AfterUpdate:
Exit Sub
Err_tbName_AfterUpdate:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_tbName_AfterUpdate
End Sub
NeoPa 32,556
Expert Mod 16PB
As Tanis says, use the StrConv() function.
That's a better solution.
NB This will do it for each 'word' in the string rather than just the very first char. I suspect that's what you're after.
This comes up from time to time, and is always a sticky situation when working with proper names, because everyone is not named John Smith! Tanis' solution won't work, for example, with john smith iii or john macsmith or john smith-bradley! It'll yield John Smith Iii, John Macsmith and John Smith-bradley. Here is a link I had squirrelled away from a very good site that addresses these problems:
http://www.mvps.org/access/strings/str0008.htm
As Tanis says, use the StrConv() function.
That's a better solution.
NB This will do it for each 'word' in the string rather than just the very first char. I suspect that's what you're after.
This comes up from time to time, and is always a sticky situation when working with proper names, because everyone is not named John Smith! Tanis' solution won't work, for example, with john smith iii or john macsmith or john smith-bradley! It'll yield John Smith Iii, John Macsmith and John Smith-bradley. Here is a link I had squirrelled away from a very good site that addresses these problems: http://www.mvps.org/access/strings/str0008.htm
Thanks Missinglinq
That's a nice link and going on my favourites list along with some other good mvp sites.
Mary
hi,
thanks for everyone yeah. in inputmask i used >L<gfsdjdkf.
it works fine. any way i 'll use this in coding
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Nacho |
last post by:
i need to convert the first letter of a veriable to uppercase (the veriable
is loaded and the applied LCase() )
thanks
--
Nacho
|
by: Alan J. Flavell |
last post by:
OK, today's email brought a comment from a reader, pointing out
something that I'd long since noticed myself but hadn't done anything
about it.
On my pages, I've got a first-letter style on...
|
by: Patrick |
last post by:
I am trying to get "first-letter" to work inline withing an anchor. Actually
I have not been able to get it to work within an <a> tag whether inline,
linked, or embedded. Using IE6 service pack 1....
|
by: Mr. B |
last post by:
In VB6, I had some code which 'forced' the first character of a string entered
to be Capital. For example, if a person was entering their name (john doe)...
the code would 'force' --- John Doe.
...
|
by: Fungii |
last post by:
Hello,
I have a stylesheet that sets p:first-letter to a certain
size and colour. I was playing around with Javascript to change
paragraph stylesheets using an array like this:
var paras =...
|
by: Tegdeep |
last post by:
Here's what I want to do:
I have a hash table which contains data associated to different keys.
The Hash keys are represented by a single character from the keyboard:
0-9, a-z, A-Z, and the...
|
by: Sven Rudolph |
last post by:
Hi,
I just made a web site and stumbeled upon something, that seems to be a
stylesheets bug in Konqueror.
When Iuse :first-letter on the a-tag, Konqueror doubles the first letter
when I click...
|
by: blyxx86 |
last post by:
I have the code to capitalize an entire string when it is input, but would like to capitalize just the first letter of a box, or match the case of a drop down list..
My current code is thus:
...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
|
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,...
|
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...
|
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...
|
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: 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...
| |