hyperlink question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • turf236@aol.com

    hyperlink question

    I am currently generating a hyperlink to a file located at the
    following directory G:\Call Center\APP\APP_ 2006\APP*001 based on a
    numberical value that in entered in on a form.

    The problem im encountering is that the network directory that im
    generating the link from has several changing variables that need to be
    taken into accoun

    G:\Call Center\APP\APP_ 2006\APP*001 - the year 2006 changes every
    year. So come the year 2007 the link needs to change to that.

    In addition the APP*001 - The * (astrick) represents a numberical value
    that changes 1 number every 999 records and then the file name entered
    in on the original for will change back to 1 and start over. Currently
    this is the code that I am using


    Private Sub File_Scan_Name_ GotFocus()
    Scanned_Contrac t.Text = "G:\Call Center\APP\APP_ 2006\APP" &
    Left(File_Scan_ Name.Value, 1) & "001\APP" & Right("0000" &
    File_Scan_Name. Value, 3) & ".tif"
    End Sub

    Can someone help me out with this there has got to be an easier way.

    Thank you -
    Turf

  • salad

    #2
    Re: hyperlink question

    turf236@aol.com wrote:
    I am currently generating a hyperlink to a file located at the
    following directory G:\Call Center\APP\APP_ 2006\APP*001 based on a
    numberical value that in entered in on a form.
    >
    The problem im encountering is that the network directory that im
    generating the link from has several changing variables that need to be
    taken into accoun
    >
    G:\Call Center\APP\APP_ 2006\APP*001 - the year 2006 changes every
    year. So come the year 2007 the link needs to change to that.
    >
    In addition the APP*001 - The * (astrick) represents a numberical value
    that changes 1 number every 999 records and then the file name entered
    in on the original for will change back to 1 and start over. Currently
    this is the code that I am using
    >
    >
    Private Sub File_Scan_Name_ GotFocus()
    Scanned_Contrac t.Text = "G:\Call Center\APP\APP_ 2006\APP" &
    Left(File_Scan_ Name.Value, 1) & "001\APP" & Right("0000" &
    File_Scan_Name. Value, 3) & ".tif"
    End Sub
    >
    Can someone help me out with this there has got to be an easier way.
    >
    Thank you -
    Turf
    >
    If the year is 2007, and 1050 docs have been created in 2007, the folder
    string will be
    G:\Call Center\APP\APP_ 2007\APP*002\

    The following code will ensure the folder exists. It creates the folder
    name. All you need to do is concatenate the folder name with the
    filename to do a FileCopy.

    Dim strFolder As String
    Dim lngCnt As Long

    'get the number of documents entered this year
    'change the field/table names to match your table structure)
    lngCount = Dcount("ID","Ta bleName","Year([DateEntered] = " & Year(date()))

    'now divide by 999 and add 1 to get folder # in 999 increments
    lngCount = (lngCount \ 999) + 1

    'now create the folder name string
    strFolder = "G:\Call Center\APP\APP_ " & Year(date()) & _
    "\APP*" & lngCount & "\"
    MakeDirFolder strFolder


    Private Sub MakeDirFolder(s trFolder As String)
    'this routine finds each folder in the path,
    'starting at the root, and ensures each folder exists
    Dim intFor As Integer
    Dim strF As String
    Dim strChar As String
    Dim strTest As String
    Dim strFolder1 As String
    For intFor = 1 To Len(strFolder)
    strChar = Mid(strFolder, intFor, 1)
    strF = strF & strChar
    If strChar = "\" Then
    strTest = DIr(strF, vbDirectory)
    If strTest = "" Then MkDir (strF)
    End If
    Next
    End Sub

    Comment

    • turf236@aol.com

      #3
      Re: hyperlink question

      Way cool - I will check this out and see how it works.

      Thank you

      salad wrote:
      turf236@aol.com wrote:
      >
      I am currently generating a hyperlink to a file located at the
      following directory G:\Call Center\APP\APP_ 2006\APP*001 based on a
      numberical value that in entered in on a form.

      The problem im encountering is that the network directory that im
      generating the link from has several changing variables that need to be
      taken into accoun

      G:\Call Center\APP\APP_ 2006\APP*001 - the year 2006 changes every
      year. So come the year 2007 the link needs to change to that.

      In addition the APP*001 - The * (astrick) represents a numberical value
      that changes 1 number every 999 records and then the file name entered
      in on the original for will change back to 1 and start over. Currently
      this is the code that I am using


      Private Sub File_Scan_Name_ GotFocus()
      Scanned_Contrac t.Text = "G:\Call Center\APP\APP_ 2006\APP" &
      Left(File_Scan_ Name.Value, 1) & "001\APP" & Right("0000" &
      File_Scan_Name. Value, 3) & ".tif"
      End Sub

      Can someone help me out with this there has got to be an easier way.

      Thank you -
      Turf
      >
      If the year is 2007, and 1050 docs have been created in 2007, the folder
      string will be
      G:\Call Center\APP\APP_ 2007\APP*002\
      >
      The following code will ensure the folder exists. It creates the folder
      name. All you need to do is concatenate the folder name with the
      filename to do a FileCopy.
      >
      Dim strFolder As String
      Dim lngCnt As Long
      >
      'get the number of documents entered this year
      'change the field/table names to match your table structure)
      lngCount = Dcount("ID","Ta bleName","Year([DateEntered] = " & Year(date()))
      >
      'now divide by 999 and add 1 to get folder # in 999 increments
      lngCount = (lngCount \ 999) + 1
      >
      'now create the folder name string
      strFolder = "G:\Call Center\APP\APP_ " & Year(date()) & _
      "\APP*" & lngCount & "\"
      MakeDirFolder strFolder
      >
      >
      Private Sub MakeDirFolder(s trFolder As String)
      'this routine finds each folder in the path,
      'starting at the root, and ensures each folder exists
      Dim intFor As Integer
      Dim strF As String
      Dim strChar As String
      Dim strTest As String
      Dim strFolder1 As String
      For intFor = 1 To Len(strFolder)
      strChar = Mid(strFolder, intFor, 1)
      strF = strF & strChar
      If strChar = "\" Then
      strTest = DIr(strF, vbDirectory)
      If strTest = "" Then MkDir (strF)
      End If
      Next
      End Sub

      Comment

      • turf236@aol.com

        #4
        Re: hyperlink question

        Ok well I could not get to work - I think I may be going through an
        access brain freeze.

        I dont know if this matters but the only reference to the scanned
        documents that are being kept on a shared server is a number file name
        number that becomes part of the hyperlink
        so the link below has the file name of 7
        G:\Call Center\APP\APP_ 2006\APP0001\AP P007.tif



        turf236@aol.com wrote:
        Way cool - I will check this out and see how it works.
        >
        Thank you
        >
        salad wrote:
        turf236@aol.com wrote:
        I am currently generating a hyperlink to a file located at the
        following directory G:\Call Center\APP\APP_ 2006\APP*001 based on a
        numberical value that in entered in on a form.
        >
        The problem im encountering is that the network directory that im
        generating the link from has several changing variables that need to be
        taken into accoun
        >
        G:\Call Center\APP\APP_ 2006\APP*001 - the year 2006 changes every
        year. So come the year 2007 the link needs to change to that.
        >
        In addition the APP*001 - The * (astrick) represents a numberical value
        that changes 1 number every 999 records and then the file name entered
        in on the original for will change back to 1 and start over. Currently
        this is the code that I am using
        >
        >
        Private Sub File_Scan_Name_ GotFocus()
        Scanned_Contrac t.Text = "G:\Call Center\APP\APP_ 2006\APP" &
        Left(File_Scan_ Name.Value, 1) & "001\APP" & Right("0000" &
        File_Scan_Name. Value, 3) & ".tif"
        End Sub
        >
        Can someone help me out with this there has got to be an easier way.
        >
        Thank you -
        Turf
        >
        If the year is 2007, and 1050 docs have been created in 2007, the folder
        string will be
        G:\Call Center\APP\APP_ 2007\APP*002\

        The following code will ensure the folder exists. It creates the folder
        name. All you need to do is concatenate the folder name with the
        filename to do a FileCopy.

        Dim strFolder As String
        Dim lngCnt As Long

        'get the number of documents entered this year
        'change the field/table names to match your table structure)
        lngCount = Dcount("ID","Ta bleName","Year([DateEntered] = " & Year(date()))

        'now divide by 999 and add 1 to get folder # in 999 increments
        lngCount = (lngCount \ 999) + 1

        'now create the folder name string
        strFolder = "G:\Call Center\APP\APP_ " & Year(date()) & _
        "\APP*" & lngCount & "\"
        MakeDirFolder strFolder


        Private Sub MakeDirFolder(s trFolder As String)
        'this routine finds each folder in the path,
        'starting at the root, and ensures each folder exists
        Dim intFor As Integer
        Dim strF As String
        Dim strChar As String
        Dim strTest As String
        Dim strFolder1 As String
        For intFor = 1 To Len(strFolder)
        strChar = Mid(strFolder, intFor, 1)
        strF = strF & strChar
        If strChar = "\" Then
        strTest = DIr(strF, vbDirectory)
        If strTest = "" Then MkDir (strF)
        End If
        Next
        End Sub

        Comment

        Working...