PC Review


Reply
Thread Tools Rate Thread

How to change "United States American" to "USA" in Access

 
 
Edmond
Guest
Posts: n/a
 
      21st May 2004
Hi Access Experts,

how to do the following?

Name ShortForm
United States America USA
Tomorrow is Friday TIF
Thank You Very Much TYVM


when I keyin a company name in the first column, it will AUTO generate the
shortform using the first alphabet of each word.

thanks in advance..


 
Reply With Quote
 
 
 
 
Edmond
Guest
Posts: n/a
 
      21st May 2004
Should read as:

> Name Short Form
> United States America USA
> Tomorrow is Friday TIF
> Thank You Very Much TYVM

"Edmond" <(E-Mail Removed)> wrote in message
news:c8k5fu$rr3$(E-Mail Removed)...
> Hi Access Experts,
>
> how to do the following?
>
> Name ShortForm
> United States America USA
> Tomorrow is Friday TIF
> Thank You Very Much TYVM
>
>
> when I keyin a company name in the first column, it will AUTO generate the
> shortform using the first alphabet of each word.
>
> thanks in advance..
>
>



 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      21st May 2004
In the change event of your Name field enter the following code:
Public Sub Name_Change()
Me.ShortForm.Value = ShortForm(Me.Name.Value)
End Sub

And include the following function (this has not been tested)

Public Function ShortForm(ByVal LongForm As String)
Dim buf() as String
Dim ret as String
Dim idx as Integer

If Len(buf) = 0 Then
ShortForm = ""
Exit Function
End If

buf = Split(LongForm, " ")

For idx = 0 To Ubound(buf)
ret = buf(idx) & buf
Next idx

ShortForm = ret
End Function

Regards,
Dan

"Edmond" <(E-Mail Removed)> wrote in message
news:c8k5mf$rrf$(E-Mail Removed)...
> Should read as:
>
> > Name Short Form
> > United States America USA
> > Tomorrow is Friday TIF
> > Thank You Very Much TYVM

> "Edmond" <(E-Mail Removed)> wrote in message
> news:c8k5fu$rr3$(E-Mail Removed)...
> > Hi Access Experts,
> >
> > how to do the following?
> >
> > Name ShortForm
> > United States America USA
> > Tomorrow is Friday TIF
> > Thank You Very Much TYVM
> >
> >
> > when I keyin a company name in the first column, it will AUTO generate

the
> > shortform using the first alphabet of each word.
> >
> > thanks in advance..
> >
> >

>
>



 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      21st May 2004
Edmond wrote:
>how to do the following?
>
> Name ShortForm
> United States America USA
> Tomorrow is Friday TIF
> Thank You Very Much TYVM
>
>
>when I keyin a company name in the first column, it will AUTO generate the
>shortform using the first alphabet of each word.



Create a function to pick up the first character after each
space. Something like this shoud do it:

Public Function ShortForm(LongForm As String) As String
Dim pos As Integer
pos = 0
Do
ShortForm = ShortForm & UCase(Mid(LongForm, pos + 1, 1))
pos = InStr(pos + 2, LongForm, " ")
Loop Until pos = 0
End Function

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      21st May 2004
On Fri, 21 May 2004 14:23:15 +0800, "Edmond" <(E-Mail Removed)>
wrote:

>Hi Access Experts,
>
>how to do the following?
>
> Name ShortForm
> United States America USA
> Tomorrow is Friday TIF
> Thank You Very Much TYVM
>
>
>when I keyin a company name in the first column, it will AUTO generate the
>shortform using the first alphabet of each word.
>
>thanks in advance..
>


Answered (also) in Formscoding.

Please DO NOT MULTIPOST. Many of the volunteers here cover several
newsgroups; if you "crosspost" by typing two or three (NO MORE!)
newsgroups on the Newsgroups line, we can see that the question has
already been answered and not waste time repeating an answer. Thank
you!

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Reply With Quote
 
Edmond
Guest
Posts: n/a
 
      22nd May 2004
thanks to all.

noted with the advise.

"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Fri, 21 May 2004 14:23:15 +0800, "Edmond" <(E-Mail Removed)>
> wrote:
>
> >Hi Access Experts,
> >
> >how to do the following?
> >
> > Name ShortForm
> > United States America USA
> > Tomorrow is Friday TIF
> > Thank You Very Much TYVM
> >
> >
> >when I keyin a company name in the first column, it will AUTO generate

the
> >shortform using the first alphabet of each word.
> >
> >thanks in advance..
> >

>
> Answered (also) in Formscoding.
>
> Please DO NOT MULTIPOST. Many of the volunteers here cover several
> newsgroups; if you "crosspost" by typing two or three (NO MORE!)
> newsgroups on the Newsgroups line, we can see that the question has
> already been answered and not waste time repeating an answer. Thank
> you!
>
> John W. Vinson[MVP]
> Come for live chats every Tuesday and Thursday
> http://go.compuserve.com/msdevapps?loc=us&access=public



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change "United States American" to "USA" in Access Edmond Microsoft Access Forms 2 3rd Jun 2004 12:20 PM
How to change "United States American" to "USA" in Access Edmond Microsoft Access Macros 2 24th May 2004 07:04 AM
How to change "United States American" to "USA" in Access Edmond Microsoft Access Forms 1 21st May 2004 04:26 PM
How to change "United States American" to "USA" in Access Edmond Microsoft Access Queries 1 21st May 2004 01:21 PM
How to change "United States American" to "USA" in Access Edmond Microsoft Access Forms 0 21st May 2004 07:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 AM.