• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

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

nFP = \\nw\data\NWI&DS_FTI\AP-Data\

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

        Debug.Print strFile

strFile value returns as -
\\nw\data\NWI&DS_FTI\AP-Data\Z:\
or
\\nw\data\NWI&DS_FTI\AP-Data\Z:\RC001\Access\RC001_ApDbms.mdb

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.

K
0
Karen Schaefer
Asked:
Karen Schaefer
  • 2
  • 2
1 Solution
 
mbizupCommented:
Try this:

strFile = nFP & Right(rs.Fields("APDBMS_DB"), Len(rs.Fields("APDBMS_DB") - 3)
0
 
Karen SchaeferAuthor Commented:
thanks, but missing something - invalid syntax
0
 
mbizupCommented:
Missed a perenthesis:

strFile = nFP & Right(rs.Fields("APDBMS_DB"), Len(rs.Fields("APDBMS_DB")) - 3)
0
 
Karen SchaeferAuthor Commented:
Great thanks,

Karen
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now