By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

hyperlink question

P: n/a
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_Contract.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

Sep 7 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
tu*****@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_Contract.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","TableName","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(strFolder 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
Sep 7 '06 #2

P: n/a
Way cool - I will check this out and see how it works.

Thank you

salad wrote:
tu*****@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_Contract.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","TableName","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(strFolder 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
Sep 14 '06 #3

P: n/a
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\APP007.tif

tu*****@aol.com wrote:
Way cool - I will check this out and see how it works.

Thank you

salad wrote:
tu*****@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_Contract.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","TableName","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(strFolder 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
Sep 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.