Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How to capitalize each word in a text string with VBA code?
    In the AfterUpdate event, I would like to capitalize each word (Title Case) in a textbox.
    Thanks in advance.
    Armstrong

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Me.FirstName = StrConv(Me.txtFirstName, vbUpperCase)
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='SteveH' post='781852' date='26-Jun-2009 16:08']Me.FirstName = StrConv(Me.txtFirstName, vbUpperCase)[/quote]
    Hi Steve,
    Thanks for your quick help.
    Now the biggest question: Can a form call both macros and subprocedures?

    Armstrong

  4. #4
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='armsys' post='781853' date='26-Jun-2009 16:21']Now the biggest question: Can a form call both macros and subprocedures?[/quote]
    To be more specific, in a Form, a textbox event calls a macro and a form event (say, BeforeUpdate) calls a VBA subprocedure. Is it possible?
    Armstrong

  5. #5
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now I've solved all issues.
    Yes, a form can call both macros and VBA code.
    The complete VBA code is shown in the screenshot.
    Thanks.
    Armstrong
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •