PC Review


Reply
Thread Tools Rate Thread

Capitalizing the first letter in a sentence.

 
 
=?Utf-8?B?RGltYXMgUGVyZXo=?=
Guest
Posts: n/a
 
      26th Jan 2006
Is it possible to automatically capitalize the first letter in a sentence? I
have searched the help topics in Access as well as the knowledge base at
Microsoft without success. I am using Access 2003.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      27th Jan 2006
I'm not familiar with a BuildIn function in Access, try this function, copy
it to a module, so all you have to is pass it the sentence and will return
capital letter for beginning of a sentence
===============================
Function CapBegOfSen(MyStr As String)
Dim I As Integer, MyFlag As Byte
If IsNull(MyStr) Or MyStr = "" Then
CapBegOfSen = ""
Exit Function
End If
MyFlag = True
For I = 1 To Len(MyStr)
If MyFlag = True And Mid(MyStr, I, 1) <> " " Then
CapBegOfSen = CapBegOfSen & UCase(Mid(MyStr, I, 1))
MyFlag = False
Else
CapBegOfSen = CapBegOfSen & Mid(MyStr, I, 1)
If Mid(MyStr, I, 1) = "." Then
MyFlag = True
End If
End If

Next I
End Function
==========================
To use it
=CapBegOfSen([Field Name])

I hope that will work out
--
\\// Live Long and Prosper \\//
BS"D


"Dimas Perez" wrote:

> Is it possible to automatically capitalize the first letter in a sentence? I
> have searched the help topics in Access as well as the knowledge base at
> Microsoft without success. I am using Access 2003.

 
Reply With Quote
 
=?Utf-8?B?RGltYXMgUGVyZXo=?=
Guest
Posts: n/a
 
      27th Jan 2006
I never used Functiosn before and have no clue as to how to use it.

"Ofer" wrote:

> I'm not familiar with a BuildIn function in Access, try this function, copy
> it to a module, so all you have to is pass it the sentence and will return
> capital letter for beginning of a sentence
> ===============================
> Function CapBegOfSen(MyStr As String)
> Dim I As Integer, MyFlag As Byte
> If IsNull(MyStr) Or MyStr = "" Then
> CapBegOfSen = ""
> Exit Function
> End If
> MyFlag = True
> For I = 1 To Len(MyStr)
> If MyFlag = True And Mid(MyStr, I, 1) <> " " Then
> CapBegOfSen = CapBegOfSen & UCase(Mid(MyStr, I, 1))
> MyFlag = False
> Else
> CapBegOfSen = CapBegOfSen & Mid(MyStr, I, 1)
> If Mid(MyStr, I, 1) = "." Then
> MyFlag = True
> End If
> End If
>
> Next I
> End Function
> ==========================
> To use it
> =CapBegOfSen([Field Name])
>
> I hope that will work out
> --
> \\// Live Long and Prosper \\//
> BS"D
>
>
> "Dimas Perez" wrote:
>
> > Is it possible to automatically capitalize the first letter in a sentence? I
> > have searched the help topics in Access as well as the knowledge base at
> > Microsoft without success. I am using Access 2003.

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      27th Jan 2006
First copy the function I provided you with into a module.
The job of this function to except a sentence and return it fixed with
capital letters

Now, if you know how to use Access functions (DlookUp , Ucase , replace ,
Cdbl , etc) then you can use the function just as any other build in
functions in Access.
==================
For example, to change a field value from text to number, you can use Cdbl

=Cdbl([TextFieldName])
====================
To add the sentence a capital letter, use the function name to return the
new string
=CapBegOfSen([Sentence field name])

Or you can create a query to return the original sentence together with the
new one

Select [Sentence field name] , CapBegOfSen([Sentence field name]) As
NewSentence From TableName

Or when you are in query design, add another field and write
NewSentence: CapBegOfSen([Sentence field name])
===================================

Now, it will be easier to explain if I know what you are trying to do with
the new sentence that come back

--
\\// Live Long and Prosper \\//
BS"D


"Dimas Perez" wrote:

> I never used Functiosn before and have no clue as to how to use it.
>
> "Ofer" wrote:
>
> > I'm not familiar with a BuildIn function in Access, try this function, copy
> > it to a module, so all you have to is pass it the sentence and will return
> > capital letter for beginning of a sentence
> > ===============================
> > Function CapBegOfSen(MyStr As String)
> > Dim I As Integer, MyFlag As Byte
> > If IsNull(MyStr) Or MyStr = "" Then
> > CapBegOfSen = ""
> > Exit Function
> > End If
> > MyFlag = True
> > For I = 1 To Len(MyStr)
> > If MyFlag = True And Mid(MyStr, I, 1) <> " " Then
> > CapBegOfSen = CapBegOfSen & UCase(Mid(MyStr, I, 1))
> > MyFlag = False
> > Else
> > CapBegOfSen = CapBegOfSen & Mid(MyStr, I, 1)
> > If Mid(MyStr, I, 1) = "." Then
> > MyFlag = True
> > End If
> > End If
> >
> > Next I
> > End Function
> > ==========================
> > To use it
> > =CapBegOfSen([Field Name])
> >
> > I hope that will work out
> > --
> > \\// Live Long and Prosper \\//
> > BS"D
> >
> >
> > "Dimas Perez" wrote:
> >
> > > Is it possible to automatically capitalize the first letter in a sentence? I
> > > have searched the help topics in Access as well as the knowledge base at
> > > Microsoft without success. I am using Access 2003.

 
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
Capitalizing first letter in sentence or email Pat Microsoft Outlook Discussion 0 5th Nov 2008 07:06 PM
Capitalizing Each Word in a Sentence Badhoonie Microsoft Word Document Management 2 14th Oct 2008 02:30 AM
automatically capitalizing the beginning of every sentence Miocuoro Windows Vista Mail 1 7th Aug 2008 12:50 AM
Auto-capitalizing the first word of a sentence/line Arnie Microsoft Word New Users 3 4th Oct 2006 12:37 PM
Capitalizing the first letter Shawna Microsoft Access Forms 0 15th Aug 2003 12:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:48 PM.