Populate one field using info from another with added text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smarmySpoot
    New Member
    • Feb 2013
    • 1

    Populate one field using info from another with added text

    I recently updated my Access 2007 database to allow images to be displayed in a form. In order for this to work, the path to the image file must be typed in a field, what I am calling ImageName.

    The images are numbered the same way as they are in the database. What I want to be able to do is pull the image number from one field, and "wrap" the path information around it in another field. Something like this:

    C:Folder\Folder \[ImageNumber].jpg where the ImageNumber, which exists in another field, can be pulled and put in the middle of the text.

    Any ideas? Thanks!
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can use the Mid() function to extract a substring. You can use the & character to concatenate multiple strings.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      My best recommendation for that is to use the functionality provided by Replace().

      Assuming you already know the path is "C:\Folder\Folde r\" then you could use :
      Code:
      strFullName = Replace("C:\Folder\Folder\#.jpg", "#", Me.txtImageNo)

      Comment

      Working...