Results 1 to 4 of 4
  1. #1
    Eeeeeemil is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Posts
    2

    Merge directory path with field value

    Hello everyone!

    I'm new to access and VBA and i'm experimenting a little trying to build a project database for my business, i've managed a lot of things so far but i'm stuck on something really simple...

    I have a hyperlink field in my form that is supposed to point to a project folder with a number corresponding to the key of the row, something like:

    \\yttecserver2\ProjektDB$\Projektmappar\119


    But i cant seem to merge the pathway "\\yttecserver2\ProjektDB$\Projektmappar" with the field for the rowkey [ProjNr] to a path...



    What i've tried so far is simply putting "\\yttecserver2\ProjektDB$\Projektmappar"+[ProjNr] In the standard value for the field, but it prompts me with this:
    "the field 'ProjNr' in the verification expression or the standard value in the table 'ProjData' are not valid in the database engine"

    Any help?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    ="\\yttecserver2\ProjektDB$\Projektmappar" & "\" & [ProjNr]

  3. #3
    Eeeeeemil is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Posts
    2
    Thanks but it didn't help. It's correct that i was missing a \ in my previous comment though.

    I tried "\\yttecserver2\ProjektDB$\Projektmappar\"+[ProjNr] and putting it in the settings for the text field itself instead of the table, whenever i create a new row (using the form) it now has the standard value "\\yttecserver2\ProjektDB$\Projektmappar\" allthough it still doesn't link to the folder itself (ProjNr).

    I think this might be due to when i press "new" in the form there hasn't yet been a number assigned to the row until i acctually write something in one of the fields of the form. Anyone know a way to get around this? I trid to but in "on click" hoping that when i press the hyperlink field it would update with the right path but i doesn't.


  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The event to use is the AfterUpdate event of the ProjNbr control. Create the correct path after an entry has been made in ProjNbr.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-27-2014, 05:41 AM
  2. Replies: 2
    Last Post: 03-16-2014, 02:12 PM
  3. Replies: 6
    Last Post: 10-26-2012, 12:53 PM
  4. Replies: 6
    Last Post: 06-15-2011, 04:38 PM
  5. New directory with the name from field
    By np1111 in forum Programming
    Replies: 14
    Last Post: 02-25-2010, 07:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums