Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Uppercase by position in field

Discussion in 'Information Technology' started by eighthman11, Jul 28, 2006.

  1. eighthman11

    eighthman11
    Expand Collapse
    Guest

    Is there a way to uppercase a letter by position. For example I want
    to upper case any character that follows a period "." in a field.
    Thanks for any help.
     
  2. Loading...


  3. Phillip Windell

    Phillip Windell
    Expand Collapse
    Guest

    What happens when it takes the sentence,
    "John S. went down the street",
    and turns it into,
    "John S. Went down the street"?

    Phil

    "eighthman11" <rdshultz@nooter.com> wrote in message
    news:1150836539.260289.242300@y41g2000cwy.googlegroups.com...
    > Is there a way to uppercase a letter by position. For example I want
    > to upper case any character that follows a period "." in a field.
    > Thanks for any help.
    >
     
  4. Graham Mandeno

    Graham Mandeno
    Expand Collapse
    Guest

    Use the AfterUpdate event of the textbox control on your form. There you
    can perform any kind of "cleanup" operations on the data and change it in
    whatever way you like.

    For example, the following code will uppercase any character preceded by a
    ".":

    Dim iPos As Integer
    iPos = 1
    Do
    iPos = InStr(iPos, MyTextbox, ".")
    If iPos = 0 Or iPos = Len(MyTextbox) Then Exit Do
    iPos = iPos + 1
    Mid(MyTextbox, iPos, 1) = UCase(Mid(MyTextbox, iPos, 1))
    Loop

    --
    Good Luck!

    Graham Mandeno [Access MVP]
    Auckland, New Zealand

    "eighthman11" <rdshultz@nooter.com> wrote in message
    news:1150836539.260289.242300@y41g2000cwy.googlegroups.com...
    > Is there a way to uppercase a letter by position. For example I want
    > to upper case any character that follows a period "." in a field.
    > Thanks for any help.
    >
     
  5. eighthman11

    eighthman11
    Expand Collapse
    Guest

    Hey Graham thanks for taking the time to help. I'm putting in the code
    now to give it a try. You're a life saver.



    Graham Mandeno wrote:
    > Use the AfterUpdate event of the textbox control on your form. There you
    > can perform any kind of "cleanup" operations on the data and change it in
    > whatever way you like.
    >
    > For example, the following code will uppercase any character preceded by a
    > ".":
    >
    > Dim iPos As Integer
    > iPos = 1
    > Do
    > iPos = InStr(iPos, MyTextbox, ".")
    > If iPos = 0 Or iPos = Len(MyTextbox) Then Exit Do
    > iPos = iPos + 1
    > Mid(MyTextbox, iPos, 1) = UCase(Mid(MyTextbox, iPos, 1))
    > Loop
    >
    > --
    > Good Luck!
    >
    > Graham Mandeno [Access MVP]
    > Auckland, New Zealand
    >
    > "eighthman11" <rdshultz@nooter.com> wrote in message
    > news:1150836539.260289.242300@y41g2000cwy.googlegroups.com...
    > > Is there a way to uppercase a letter by position. For example I want
    > > to upper case any character that follows a period "." in a field.
    > > Thanks for any help.
    > >
     

Share This Page