Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182
    Actually, I reimported my data. Originally, I had it in Excel, which is where the carrier returns came from. It was easier to remove the returns and spaces from Excel. But I do have a related question.



    In my long text field, I was to remove all return carriages After_Update.


    In your post above, you identify this code:


    Sub xspace()
    'chr(10) new line LF
    'chr(13) carriage return
    Dim x As String: x = "a" & "a" & Chr(13) & Chr(10) & " 2017ghjkl plkjhgfd" & Chr(13) & Chr(10) & "axxx"

    x = Replace(x, "a", "")
    Debug.Print "1 " & x

    x = Replace(x, Chr(13) & Chr(10), "")
    Debug.Print "2 " & x

    x = Replace(x, " ", "")
    Debug.Print "3 " & x
    End Sub


    I am very confused as to whats going on here. What is the "ghjkl plkjhgfd" and "axxx"?

    Is there not a simple code like "vbProperCase(Me.Details)"

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Orange is just building a string value to use as example data for the code to act on. You would instead reference your control to get a value. Adapt code for your situation.

    So code in your After_Update event could be:

    Sub yourtextboxname_AfterUpdate()
    Me.yourtextboxname = REPLACE(REPLACE(Me.yourtextboxname, Chr(13) & Chr(10),"")," ","")
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 04-27-2017, 11:00 AM
  2. Query returns nothing
    By jtmott in forum Access
    Replies: 12
    Last Post: 11-04-2015, 09:00 AM
  3. update/remove character from field
    By Ruegen in forum Queries
    Replies: 6
    Last Post: 01-23-2014, 05:08 PM
  4. Cell phone carrier detection
    By crowegreg in forum Programming
    Replies: 4
    Last Post: 03-21-2013, 12:03 PM
  5. Access Update Query returns -1
    By Chris Morag in forum Queries
    Replies: 2
    Last Post: 05-27-2011, 06:02 AM

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