Results 1 to 3 of 3

Thread: Trim a field?

  1. #1
    Join Date
    Nov 2004
    Posts
    35

    Unanswered: Trim a field?

    I suspect there is probably an obvious answer to this one.

    I want to create a directory based on a field in my database as part of a function (using mkdir).

    strDirectory = "c:\myDir" & Trim(rst.Fields("myField").Value)
    strDirectory = "c:\myDir" & Trim([myField])

    Neither of these work - can anyone shed any light?

    Marion

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    At a quick glance you may need to include a "\", unless this is already included in [myfield]

    eg
    strDirectory = "c:\myDir\" & Trim(rst.Fields("myField").Value)
    strDirectory = "c:\myDir\" & Trim([myField])

  3. #3
    Join Date
    Nov 2004
    Posts
    35

    Trim

    Thanks, Healdem, my actual code was correct.

    And sorry, folks, I discovered meantime that the field contains a null rather than a space so I just created an update query to change that and everything's OK now.

    Thanks
    Marion

Posting Permissions

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