Results 1 to 2 of 2
  1. #1
    johnbr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    1

    Question Adding leading spaces to a field

    Hi All,

    I'm very new to access...

    How can I add dynamic leading spaces to a query field? Essentially, I need to look at a trimmed field, and then duplicate it. However, the string needs to always have 10 characters. If the value is 405, I need 7 spaces in front of it. ' 405'

    Something similar to:



    if len([q_LPP.Item]) <= 10 then [q_LPP.Item] + space(10 - len([q_LPP.Item])) else [q_LPP.Item]

    Thanks for your help.

    John

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    If it is always numeric then you can change it to a number which will do that for you.

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

Similar Threads

  1. Spaces Stripped from Append Query Field
    By alawless in forum Queries
    Replies: 11
    Last Post: 08-08-2011, 10:45 PM
  2. Adding Leading Zeros
    By jo15765 in forum Access
    Replies: 13
    Last Post: 11-20-2010, 11:11 PM
  3. How to make a field accept No spaces
    By jhjarvie in forum Forms
    Replies: 4
    Last Post: 09-26-2009, 04:10 PM
  4. Find Spaces in Field
    By stottle in forum Queries
    Replies: 6
    Last Post: 08-17-2009, 02:02 AM
  5. Replies: 9
    Last Post: 07-16-2009, 09:13 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