trim portion of a string - removing the first 3 from the left of a string

Posted on 2011-10-20
Last Modified: 2012-05-12
nFP = \\nw\data\NWI&DS_FTI\AP-Data\

strFile = nFP & Left(rs.Fields("APDBMS_DB"), 3)

        Debug.Print strFile

strFile value returns as -

I need to replace via code the drive letter to the UNC.  the string with the original filepath is stored with a drive letter and cannot be changed in the data.  I need to convert the drive letter into the proper UNC via concatenation.

What am I doing wrong - I tried both Left and LTRIM - without success.

Question by:Karen Schaefer
    LVL 61

    Expert Comment

    Try this:

    strFile = nFP & Right(rs.Fields("APDBMS_DB"), Len(rs.Fields("APDBMS_DB") - 3)

    Author Comment

    by:Karen Schaefer
    thanks, but missing something - invalid syntax
    LVL 61

    Accepted Solution

    Missed a perenthesis:

    strFile = nFP & Right(rs.Fields("APDBMS_DB"), Len(rs.Fields("APDBMS_DB")) - 3)

    Author Closing Comment

    by:Karen Schaefer
    Great thanks,


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now