B
Barry
Hello,
The following code is used on the double click of a text box so that when a
new job(record) is created the user can double click the box which then
creates a folder on our server at the correct location. This seems to be
working fine but what i need to do is write the value back into the text box
as a hyperlink but i get the error "The hyperlinkAddress is read only for
this hyperlink"
Can anybody help me with this code as i have been trying to create these
links for weeks now but to no avail?
-----------------------------------------------------------
Private Sub txtAttach_DblClick(Cancel As Integer)
Dim drive As String
Dim office As String
Dim NetworkLocation As String
Dim folder As String
If Me.txtDomain.Value = "MWLS" Then
drive = "L:\"
office = "Limerick\"
End If
If Me.txtDomain.Value = "MWLSdub" Then
drive = "L:\"
office = "Dublin\"
End If
If Me.txtDomain.Value = "NORTHERNLIFTS" Then
drive = "L:\"
office = "Belfast\"
End If
folder = drive & "" & "Internal Data\Estimating\" & office & "Pre Award
Projects\" & Me.txtFirstLetter.Value
NetworkLocation = drive & "" & "Internal Data\Estimating\" & office &
"Pre Award Projects\" & Me.txtFirstLetter.Value & "\" & Me.chrJobname.Value
If Len(Dir(folder, vbDirectory)) = 0 Then
MsgBox "Do you want to create a folder at" & folder, vbInformation
MkDir folder
End If
If Len(Dir(NetworkLocation, vbDirectory)) = 0 Then
MsgBox "Do you want to create a folder at " & NetworkLocation,
vbInformation
MkDir NetworkLocation
Me.txtAttach.Hyperlink.Address = NetworkLocation
Me.txtAttach.Hyperlink.TextToDisplay = Me.chrJobname.Value
MsgBox "This folder exists", vbInformation
Else
MsgBox "This folder already exists", vbInformation
End If
End Sub
--------------------------------------------------------
The following code is used on the double click of a text box so that when a
new job(record) is created the user can double click the box which then
creates a folder on our server at the correct location. This seems to be
working fine but what i need to do is write the value back into the text box
as a hyperlink but i get the error "The hyperlinkAddress is read only for
this hyperlink"
Can anybody help me with this code as i have been trying to create these
links for weeks now but to no avail?
-----------------------------------------------------------
Private Sub txtAttach_DblClick(Cancel As Integer)
Dim drive As String
Dim office As String
Dim NetworkLocation As String
Dim folder As String
If Me.txtDomain.Value = "MWLS" Then
drive = "L:\"
office = "Limerick\"
End If
If Me.txtDomain.Value = "MWLSdub" Then
drive = "L:\"
office = "Dublin\"
End If
If Me.txtDomain.Value = "NORTHERNLIFTS" Then
drive = "L:\"
office = "Belfast\"
End If
folder = drive & "" & "Internal Data\Estimating\" & office & "Pre Award
Projects\" & Me.txtFirstLetter.Value
NetworkLocation = drive & "" & "Internal Data\Estimating\" & office &
"Pre Award Projects\" & Me.txtFirstLetter.Value & "\" & Me.chrJobname.Value
If Len(Dir(folder, vbDirectory)) = 0 Then
MsgBox "Do you want to create a folder at" & folder, vbInformation
MkDir folder
End If
If Len(Dir(NetworkLocation, vbDirectory)) = 0 Then
MsgBox "Do you want to create a folder at " & NetworkLocation,
vbInformation
MkDir NetworkLocation
Me.txtAttach.Hyperlink.Address = NetworkLocation
Me.txtAttach.Hyperlink.TextToDisplay = Me.chrJobname.Value
MsgBox "This folder exists", vbInformation
Else
MsgBox "This folder already exists", vbInformation
End If
End Sub
--------------------------------------------------------