Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Space Suffixes (Access 2003)

    When entering text into a field, I would like to intensionally leave a space at the end of some text strings, but Access removes it after leaving the cell/field. Is their a way to keep the space character?

    Thanks,
    Drew

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Perhaps using the "After Update" would be your solution.

    You can update a field with VBE code and include a space !!

    ' After_Update

    <pre>Me.txtPhrase = "Ten Spaces After This "</pre>


  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Space Suffixes (Access 2003)

    Hi Drew

    How will you determine which text strings will have a space after them, or is is all of them.

    A way you could do this is have the form run from a query. We shall call this field for argument sake [PartNo]. In the same query, but not shown in the form a created field which states NewPartNo: [PartNo]&" ".

    An idea but I am unclear why it is for "some" text strings
    Jerry

  4. #4
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Jerry,

    What I have is 3 tables (T_Alias which contains fields 'Alias' and 'Mfr' along with a few others; T_AgileData which contains a Description along with a few others; and T_Instances which contain a instance field and a few others). I currently have a script that when ran will look into the Description field and pull any alias (or aliases) into the T_Instance table (along with other information). What my problem is, is sometimes an alias is only 2 characters long (ex: TI), which when the script is run will pull a large amount of unwanted data (TILL, TIMER, TINNED, TINTED, etc when what I really want is all manufactures that are TI . If I could include a space at the string's suffix, this would dramatically decrease the amount of unwanted records that I return.

    I know that I could include another field in T_Alias that would indicate when a SPACE is to be included at the end of the string, but I hoping that I wouldn't have to add a field just for this.

    Thanks!!!
    Drew

  5. #5
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Please see the reply to Jezza.

    Thanks,
    Drew

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Space Suffixes (Access 2003)

    What if the alias is 3 characters long, e.g. TIN? Do you want to pick up TINNED and TINTED then?

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Space Suffixes (Access 2003)

    Because Access strips spaces from the end of text fields prior to storing it what you may be able to do is to put a special character ( say an @ ) in the place of the space. Then when you run your script simply replace the @ with a space.

    This is slightly simpler than an extra field depending upon your point of view.

  8. #8
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Hans,

    It would all depend how I wanted to specify the string in T_Alias.

    Regards,
    Drew

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Space Suffixes (Access 2003)

    But there has to be some kind of system to it... <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    I'm afraid I do not understand what you are doing.

  10. #10
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Pat,

    I thought about this and thought about using quotes, but before I did I wanted to make sure that Access didn't have some option where it would leave the space. Doesn't sound like it does.

    Thanks,
    Drew

  11. #11
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Hans,

    My end goal is to identify all manufactures that are embedded in the description field by using a script that loops through the entire table. The script uses T_Alias to find the manufacture that resides in the description field then moves that alias to both another field in T_AgileData and another field in the table T_Instances. Since some aliases are short, I'm getting data that is unwanted and I could decrease the amount of records if I could indicate a space in the Alias field (ex: "TI "). I can do this if I would paste "TI " into the field, but when I try to type this in, Access removes the space suffix.

    Thanks!
    Drew

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Space Suffixes (Access 2003)

    How does your code work? Perhaps it could be modified to do what you want.

  13. #13
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Hans,

    I agree. I was thinking that I could use quotations at the beginning and the end of the text field. When the script ran, it would ignore the quotes. This is what my original thought was, but I would prefer to be able to add the space suffix to the text field in the table and be done with it. From what I get from the other responces, Access won't do this???

    Thanks,
    Drew

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Space Suffixes (Access 2003)

    Access will always remove trailing spaces entered manually. I repeat, it may be possible to modify the code to work the way you want without addding spaces or quotes in the table itself, but we'd need to know more about the code to be able to help with that.

  15. #15
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Space Suffixes (Access 2003)

    Hans,

    I've attached the code. Their is a lot going on here, so if you would like me to add the database file, I would be happy to.

    Regards,
    Drew

Page 1 of 2 12 LastLast

Posting Permissions

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