Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / February 2006

Tip: Looking for answers? Try searching our database.

Changing from capital to small letters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dimitris - 30 Jan 2006 23:19 GMT
Hello I have a table in which there is a field LNAME in which last names
have been entered with capitol letters. For example: SMITH.
I want to change them to small letters except the first one, so it will
become:  Smith
Is it possible?

Thank you
Dimitris
Ed Warren - 30 Jan 2006 23:32 GMT
try:

StrConv(strPassed, vbProperCase)

Ed Warren

> Hello I have a table in which there is a field LNAME in which last names
> have been entered with capitol letters. For example: SMITH.
[quoted text clipped - 4 lines]
> Thank you
> Dimitris
Al Camp - 31 Jan 2006 00:27 GMT
Dimitris,
  Just an minor addition to Ed's correct response.  It's the best you can
do for automating the solution to your poblem
Be aware though, that names like...
       MCCARTHY
would come out as
       Mccarthy
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

> Hello I have a table in which there is a field LNAME in which last names
> have been entered with capitol letters. For example: SMITH.
[quoted text clipped - 4 lines]
> Thank you
> Dimitris
Dimitris - 31 Jan 2006 09:19 GMT
Thank you for your answers.
I just can't figure where to write it.
I made a querie and wrote it at the SQL view but wasn;t accepted.
Please tell me where to write it. What steps should I do?
Thank You
Dimitris

> Dimitris,
>   Just an minor addition to Ed's correct response.  It's the best you can
[quoted text clipped - 16 lines]
>> Thank you
>> Dimitris
Ed Warren - 31 Jan 2006 11:05 GMT
Open a new query window in design view.
Add the table with the field of interest
add the field LNAME
in the next box over add the following
LnameProperCase: StrConv([LNAME], vbProperCase)
run the query to see the results.

If after you see what the code does to the fields, and you like it, and you
want to change the stored data.
Then
change the query type to update
copy the code:  StrConv([LNAME], vbProperCase) into the updateto box under
the LNAME field, run the query.

Ed Warren

> Thank you for your answers.
> I just can't figure where to write it.
[quoted text clipped - 23 lines]
>>> Thank you
>>> Dimitris
John Spencer - 31 Jan 2006 13:17 GMT
Ed,
As far as I know, queris don't recognize the visual basic constants, so you
have to specify the actual value.

Therefore StrConv([LNAME], vbProperCase) should be StrConv([LName],3)

> Open a new query window in design view.
> Add the table with the field of interest
[quoted text clipped - 39 lines]
>>>> Thank you
>>>> Dimitris
Ed Warren - 31 Jan 2006 14:12 GMT
Yes you are correct replace the constant vbProperCase with the number 3

Thanks,

Ed Warren

> Ed,
> As far as I know, queris don't recognize the visual basic constants, so
[quoted text clipped - 45 lines]
>>>>> Thank you
>>>>> Dimitris
Dimitris - 31 Jan 2006 16:43 GMT
Thank you all,
It worked fine, I am very happy about this.
Only one issue which has to do with the Greek grammar and it won't make
sense if I explain it. I just have to do this. After using the code you told
me I have to change the last letter of some names. To stay at my first
example "SMITH" became "Smith" but how can I change now the "h" at the end
of "Smith" with another letter. I need to change ALL the letters "h" at THE
END of names only.
So in my mind it's something like: Wherever a name ends with "h" change it
with "c" for example. Well in Greek we have 2 possibilities for a letter so
I need to change it to the other one, that is why I need this.
Thank you in advance
Dimitris

> Yes you are correct replace the constant vbProperCase with the number 3
>
[quoted text clipped - 51 lines]
>>>>>> Thank you
>>>>>> Dimitris
Tom Lake - 31 Jan 2006 16:57 GMT
> So in my mind it's something like: Wherever a name ends with "h" change it with "c"
> for example. Well in Greek we have 2 possibilities for a letter so I need to change
> it to the other one, that is why I need this.
> Thank you in advance
> Dimitris

IIf(Right([TestString], 1) = "h", Left([TestString], Len([TestString]) - 1) & "c",
[TestString])

Tom Lake
Dimitris - 01 Feb 2006 10:17 GMT
Thanks Tom,

It didn't work. I created an update querie and wrote it in the "Update to"
line. But a window  appears asking me to write what  [TestString] is.
Can you please tell me what I am supposed to do and where I should write it?
Dimitris

>> So in my mind it's something like: Wherever a name ends with "h" change
>> it with "c" for example. Well in Greek we have 2 possibilities for a
[quoted text clipped - 6 lines]
>
> Tom Lake
John Spencer - 01 Feb 2006 13:04 GMT
Dimitris,

Since you seem to be using the query grid, Try the following after you
BACKUP your data - queries are not undoable.

Field: LName
Criteria: LIKE "*h"
Update To: Left([Lname],Len([Lname])-1) & "c"

> Thanks Tom,
>
[quoted text clipped - 14 lines]
>>
>> Tom Lake
Dimitris - 01 Feb 2006 13:48 GMT
Thanks John
It worked fine.

> Dimitris,
>
[quoted text clipped - 24 lines]
>>>
>>> Tom Lake
Bob Miller - 31 Jan 2006 14:16 GMT
Place this function in a module:
Function Proper(Pr)
Proper = StrConv(Pr, vbProperCase)
End Function

Then you can put this:
LName=Proper([LNAME])
in a query field.

Dimitris Wrote:
> Thank you for your answers.
> I just can't figure where to write it.
[quoted text clipped - 28 lines]
> Thank you
> Dimitris

Signature

Bob Miller

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.