Use the Trim function in Access

elbazdaniel Posted messages 14 Status Member -  
yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   -
Hello,

I’m struggling with the Trim function or more precisely, I don't know where to use it.
I want to remove the trailing spaces from a column in an Access database because it causes bugs and crashes.
Help... I’m trying to use the Microsoft explanations but I don't understand anything...
Can you help me, please? It’s true that this is a step-by-step guidance issue.
Thank you
Daniel

Configuration: Windows / Chrome 63.0.3239.84

--

2 answers

  1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   Ambassadeur 1 588
     
    I think it will be enough to do:
    UPDATE totrim SET txt = rtrim(txt);
    1
    1. zonteomer74 Posted messages 31 Status Member 2
       
      Hello.
      How and where exactly should I insert this code because I'm interested?
      0
      1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > zonteomer74 Posted messages 31 Status Member
         
        First of all, you need to modify the text I proposed. You should replace "totrim" with the name of your table, and "txt" (twice) with the name of your field.

        Then, under the Create tab, in the Queries group, click on Query Design. Note: if you are using Access 2007, under the Create tab, in the Other group, click on Query Design.

        Close the Show Table dialog box.

        Click on the SQL button. Replace the displayed text ("SELECT...") with the modified suggested text.

        Click on the "run" button.
        0
  2. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   Ambassadeur 1 588
     
    Hello, do you want to modify the content of the database, or do you want to ignore the spaces when you use the information from your database?
    Can you share the name of your table, the name and type of your text field?
    0
    1. Daniel
       
      Hello yg
      I would like to permanently remove these blanks
      Thank you
      0
    2. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > Daniel
       
      Can you share the name of your table, the name and type of your text field?
      0
    3. elbazdaniel Posted messages 14 Status Member
       
      Hello
      after testing ... it does not permanently remove the spaces at the end of the string.
      0
    4. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > elbazdaniel Posted messages 14 Status Member
       
      Can you share your file?
      0
    5. elbazdaniel Posted messages 14 Status Member
       
      it's over 100 megabytes
      0