Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    convert textbox to proper case After Update

    Hey guys,



    I am trying to convert the text in a textbox via VBA using the After Update. I currently have:

    Code:
    Private Sub Fname_AfterUpdate()
    Dim result As String
    Dim field As String
    
    
    field = Me.Fname
    
    
    result = StrConv(field, vbProperCase)
     
    field = result
    
    
    End Sub
    Doesn't seem to do anything though. What am I doing wrong?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You should only need:
    Me.Fname= StrConv(Me.Fname, vbProperCase)

    Have checked that the code actually fires.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    All this does is set the values of two variables. Set a breakpoint and run code. Does the procedure execute? Are the variables set?

    Try simply:

    Private Sub Fname_AfterUpdate()
    Me.Fname= StrConv(Me.Fname, vbProperCase)
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Oh wow. Thanks guys.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Textbox Case Sensitive
    By cbrsix in forum Programming
    Replies: 19
    Last Post: 06-25-2012, 10:52 AM
  2. Proper Case or Capitalization help
    By tshirttom in forum Programming
    Replies: 5
    Last Post: 03-23-2012, 10:37 AM
  3. Convert VALUE in Textbox to CAPS in TABLE
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 12-30-2011, 05:04 PM
  4. make textbox lookup values case insensitive
    By sephiroth2906 in forum Forms
    Replies: 2
    Last Post: 04-22-2011, 10:36 AM
  5. Setting the Default Value and Proper Case Example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums