#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Appending a value from one field to another


    Hi

    I have a form which has a field called "txtImageName" with a default value which will be a UNC path to a network folder.

    I want to append to this path a value that is entered in another field called "Username". How do I go about doing this?

    Also I'd like to be able to hide the network path from view, showing only the filename in the "txtImageName" field if possible.

    Cheers
  2. #2
  3. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    Code:
    me.txtImagename = me.txtImagename & me.username
    Set the visible property of the [txtImageName] field to no, should hide the field.
    To display just the field name, it would help to know more about the full string you're using for the network path. Is it always the same path? How is the file name determined? is it input by the user, or does the database assign the name itself?
  4. #3
  5. Moderator
    ASP Super Genius (4500 - 4999 posts)

    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,618
    Rep Power
    650
    What version of Access are you using? Are you trying to dynamically display images with records?

    Access 2007 introduced ControlSource property to Image control. Are you using Image control?
    I like to know if my suggestion helped you. One way to let me know is by clicking star at bottom left corner of post.
    Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0
    Brilliant thanks meratigoerr. I've amended it slightly as the images will always be held in the same location so now have
    Code:
    Me.txtImageName = "\\servername\share\pictures\" & Me.Username & ".jpg"
    as an After Update event on the "Username" field which is now appending the value entered here to the end of the defined network path into the txtImageName field as I wanted. Thanks again....How can I thank you on the post as there doesn't appear to be a star at the bottom of the post frame!?

    I didn't mean hide the txtImageName field, I meant hide the network path shown in this field so that only the filename that's getting appended appears!

    @June7: I already have an Image Frame with a control source reading from the txtImageName so wanted to auto-populate the field based on the username which is also the same name as the image that will be stored on the network drive.

Similar Threads

  1. Appending a field value containing date to an output filename
    By ciru in forum Microsoft Access Help
    Replies: 4
    Last Post: July 17th, 2012, 09:29 PM
  2. Change the color of the inserted text while appending a text area field
    By shankari in forum HTML, JavaScript And CSS Help
    Replies: 2
    Last Post: June 25th, 2009, 07:07 AM
  3. appending to XML with ASP
    By mat106 in forum ASP Development
    Replies: 1
    Last Post: August 11th, 2004, 03:40 AM
  4. appending to a table
    By combat wombat in forum Microsoft Access Help
    Replies: 2
    Last Post: June 9th, 2004, 07:17 AM
  5. Replies: 2
    Last Post: May 12th, 2004, 01:47 PM

IMN logo majestic logo threadwatch logo seochat tools logo