A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hyperlink question



 
 
Thread Tools Display Modes
  #21  
Old June 25th, 2008, 07:08 PM posted to microsoft.public.access.forms
Vylent Fyre[_2_]
external usenet poster
 
Posts: 41
Default Hyperlink question

You rock, Douglas!!! Totally ROCK!

This is what I did that worked (thanks to YOU!)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

You had (HyperlinkAddress but Access (I'm sure my version of it) didn't like
that so I changed it to HyperlinkPart and it worked PERFECTLY! 100% I
cannot thank you enough; this has helped me SO much! Thank you!!!

Do you have any websites that has information about Access? I would
definitely go there before pestering other people first =)

Vylent Fyre
"Douglas J. Steele" wrote:

Make that

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

or

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress), vbDirectory)) = 0
Then


If it still doesn't work, does HyperlinkAddress (or HyperlinkPart) return a
terminating slash?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" wrote in message
...
That's supposed to be

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDir)) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
Not a problem, Douglas!

I had changed it to vbDirectory and same results. And yes the = 0 is on
one
line =) The code won't work without that on one line

Here's a copy of the coding - It's working great except it's still
showing
"File/Directory not found" for the scanned links that are linking to a
directory. I click on the link in the query that feeds this report and
the
link opens up the directory in Windows Explorer which is correct. I'm
totally stumped on this because it should be working! The code look 100%
right to my eyes...



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, vbDir))) = 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub

"Douglas J. Steele" wrote:

Sorry, I was going by memory. Where I have acDirectory, it should be
vbDirectory. (Hopefully you realize that the = 0 Then part should be on
the
same line)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Douglas,

That exact coding produced errors but I did do the following ways and
I
still get the "File/Directory Not Found" on the ones that have valid
links
to
the directories (The links to files work perfectly! I am still doing
backflips over this!)

Here are the three different ways I've tried:

Your exact coding kept producing errors -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress),
acDirectory))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


So I fixed it to do this (No errors in the codings and the report
ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
acDirectory)))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



And this way (No errors and report ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acDirectory))) = 0
Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



Then lastly, out of desperation, broke them up into two separate If
Statements thinking maybe that was why it wouldn't work originally....


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then
Me.Text83 = "file not found"
Else
Me.Text83 = "File confirmed"
End If

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress, vbDirectory)))
= 0 Then
Me.Text83 = "Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If

End Sub


I am so sorry to keep pestering you - But I'm so close I can taste it
so...
I'm like a dog with a bone; I won't let go until it's done =)


VF


"Douglas J. Steele" wrote:

Try playing with

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress)),
vbDirectory)
= 0 Then
Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
news It works beautifully! I'm so happy about this =) This is
FANTASTIC!

Now just a couple more questions (for anyone who has the time to
respond!)

Sometimes we have JE's that are too large to be in one file so we
have
to
break them up into two files - When this occurs they're stored in a
directory
and the link is to the directory, not a file because it's more than
one
file.
When it sees these, it's showing it, of course, as "File Not Found"
which
is
true because it isn't a file. Is there a way I could add another
Iif
statement that would tell it if it is a Dir standalone, to state
"Directory
Found"?

Also, is there a way I could have another report to only show the
"File
Not
Found"? This way I could pass these out accordingly and get these
links
fixed.

MANY MANY MANY thanks to you, Douglas, a true genius, and to all
you
geniuses out there!! =)



"Douglas J. Steele" wrote:

Try

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "File not found"
Else
Me.Text83 = "File confirmed"
End If

End Sub


If you still run into problems, try

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link))) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
...
Ooohh - I made myself sound silly - I took out the MsgBox (that
was
there
for
referencial purposes) and with the MsgBox out of the way, it
just
goes
straight to the coding line - So I'm sure I have that wrong
somehow.

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Scanned_JE_Link, acAddress))) = 0 Then
Let Text83 = "File not found"
Else
Let Text83 = "File confirmed"
End If

  #22  
Old June 25th, 2008, 07:43 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Hyperlink question

Jeff Conrad has an excellent set of links to good Access sites at
http://www.accessmvp.com/JConrad/acc...resources.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
You rock, Douglas!!! Totally ROCK!

This is what I did that worked (thanks to YOU!)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

You had (HyperlinkAddress but Access (I'm sure my version of it) didn't
like
that so I changed it to HyperlinkPart and it worked PERFECTLY! 100% I
cannot thank you enough; this has helped me SO much! Thank you!!!

Do you have any websites that has information about Access? I would
definitely go there before pestering other people first =)

Vylent Fyre
"Douglas J. Steele" wrote:

Make that

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

or

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress), vbDirectory)) =
0
Then


If it still doesn't work, does HyperlinkAddress (or HyperlinkPart) return
a
terminating slash?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" wrote in message
...
That's supposed to be

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDir)) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
Not a problem, Douglas!

I had changed it to vbDirectory and same results. And yes the = 0 is
on
one
line =) The code won't work without that on one line

Here's a copy of the coding - It's working great except it's still
showing
"File/Directory not found" for the scanned links that are linking to a
directory. I click on the link in the query that feeds this report
and
the
link opens up the directory in Windows Explorer which is correct. I'm
totally stumped on this because it should be working! The code look
100%
right to my eyes...



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, vbDir))) = 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub

"Douglas J. Steele" wrote:

Sorry, I was going by memory. Where I have acDirectory, it should be
vbDirectory. (Hopefully you realize that the = 0 Then part should be
on
the
same line)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Douglas,

That exact coding produced errors but I did do the following ways
and
I
still get the "File/Directory Not Found" on the ones that have
valid
links
to
the directories (The links to files work perfectly! I am still
doing
backflips over this!)

Here are the three different ways I've tried:

Your exact coding kept producing errors -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress),
acDirectory))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


So I fixed it to do this (No errors in the codings and the report
ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
acDirectory)))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



And this way (No errors and report ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acDirectory))) = 0
Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



Then lastly, out of desperation, broke them up into two separate If
Statements thinking maybe that was why it wouldn't work
originally....


Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "file not found"
Else
Me.Text83 = "File confirmed"
End If

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
vbDirectory)))
= 0 Then
Me.Text83 = "Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If

End Sub


I am so sorry to keep pestering you - But I'm so close I can taste
it
so...
I'm like a dog with a bone; I won't let go until it's done =)


VF


"Douglas J. Steele" wrote:

Try playing with

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress)),
vbDirectory)
= 0 Then
Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
news It works beautifully! I'm so happy about this =) This is
FANTASTIC!

Now just a couple more questions (for anyone who has the time to
respond!)

Sometimes we have JE's that are too large to be in one file so
we
have
to
break them up into two files - When this occurs they're stored
in a
directory
and the link is to the directory, not a file because it's more
than
one
file.
When it sees these, it's showing it, of course, as "File Not
Found"
which
is
true because it isn't a file. Is there a way I could add
another
Iif
statement that would tell it if it is a Dir standalone, to state
"Directory
Found"?

Also, is there a way I could have another report to only show
the
"File
Not
Found"? This way I could pass these out accordingly and get
these
links
fixed.

MANY MANY MANY thanks to you, Douglas, a true genius, and to all
you
geniuses out there!! =)



"Douglas J. Steele" wrote:

Try

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "File not found"
Else
Me.Text83 = "File confirmed"
End If

End Sub


If you still run into problems, try

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link))) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
...
Ooohh - I made myself sound silly - I took out the MsgBox
(that
was
there
for
referencial purposes) and with the MsgBox out of the way, it
just
goes
straight to the coding line - So I'm sure I have that wrong
somehow.

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Scanned_JE_Link, acAddress))) = 0
Then
Let Text83 = "File not found"
Else
Let Text83 = "File confirmed"
End If



  #23  
Old June 25th, 2008, 10:21 PM posted to microsoft.public.access.forms
Vylent Fyre[_2_]
external usenet poster
 
Posts: 41
Default Hyperlink question

One more thing - Is there a way I could add a sort option? Basically, I'd
like the report to show the "File/Directory not found" on top of the report,
then "Dir confirmed" then "File confirmed" - could I make the report do this
with this coding? I know how to write it if it was a field but this isn't a
field/control....


"Douglas J. Steele" wrote:

Make that

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

or

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress), vbDirectory)) = 0
Then


If it still doesn't work, does HyperlinkAddress (or HyperlinkPart) return a
terminating slash?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" wrote in message
...
That's supposed to be

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDir)) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
Not a problem, Douglas!

I had changed it to vbDirectory and same results. And yes the = 0 is on
one
line =) The code won't work without that on one line

Here's a copy of the coding - It's working great except it's still
showing
"File/Directory not found" for the scanned links that are linking to a
directory. I click on the link in the query that feeds this report and
the
link opens up the directory in Windows Explorer which is correct. I'm
totally stumped on this because it should be working! The code look 100%
right to my eyes...



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, vbDir))) = 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub

"Douglas J. Steele" wrote:

Sorry, I was going by memory. Where I have acDirectory, it should be
vbDirectory. (Hopefully you realize that the = 0 Then part should be on
the
same line)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Douglas,

That exact coding produced errors but I did do the following ways and
I
still get the "File/Directory Not Found" on the ones that have valid
links
to
the directories (The links to files work perfectly! I am still doing
backflips over this!)

Here are the three different ways I've tried:

Your exact coding kept producing errors -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress),
acDirectory))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


So I fixed it to do this (No errors in the codings and the report
ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
acDirectory)))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



And this way (No errors and report ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acDirectory))) = 0
Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



Then lastly, out of desperation, broke them up into two separate If
Statements thinking maybe that was why it wouldn't work originally....


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then
Me.Text83 = "file not found"
Else
Me.Text83 = "File confirmed"
End If

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress, vbDirectory)))
= 0 Then
Me.Text83 = "Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If

End Sub


I am so sorry to keep pestering you - But I'm so close I can taste it
so...
I'm like a dog with a bone; I won't let go until it's done =)


VF


"Douglas J. Steele" wrote:

Try playing with

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress)),
vbDirectory)
= 0 Then
Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
news It works beautifully! I'm so happy about this =) This is
FANTASTIC!

Now just a couple more questions (for anyone who has the time to
respond!)

Sometimes we have JE's that are too large to be in one file so we
have
to
break them up into two files - When this occurs they're stored in a
directory
and the link is to the directory, not a file because it's more than
one
file.
When it sees these, it's showing it, of course, as "File Not Found"
which
is
true because it isn't a file. Is there a way I could add another
Iif
statement that would tell it if it is a Dir standalone, to state
"Directory
Found"?

Also, is there a way I could have another report to only show the
"File
Not
Found"? This way I could pass these out accordingly and get these
links
fixed.

MANY MANY MANY thanks to you, Douglas, a true genius, and to all
you
geniuses out there!! =)



"Douglas J. Steele" wrote:

Try

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "File not found"
Else
Me.Text83 = "File confirmed"
End If

End Sub


If you still run into problems, try

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link))) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
...
Ooohh - I made myself sound silly - I took out the MsgBox (that
was
there
for
referencial purposes) and with the MsgBox out of the way, it
just
goes
straight to the coding line - So I'm sure I have that wrong
somehow.

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Scanned_JE_Link, acAddress))) = 0 Then
Let Text83 = "File not found"
Else
Let Text83 = "File confirmed"
End If

  #24  
Old June 26th, 2008, 12:00 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Hyperlink question

I believe the only way would be to put the logic to determine
"File/Directory not found", "Dir confirmed" and "File confirmed" into the
query. You could try creating a function that returns the value and calling
the function in your query, but you could run into problems, depending on
the Sandbox Mode under which you're running.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
One more thing - Is there a way I could add a sort option? Basically, I'd
like the report to show the "File/Directory not found" on top of the
report,
then "Dir confirmed" then "File confirmed" - could I make the report do
this
with this coding? I know how to write it if it was a field but this isn't
a
field/control....


"Douglas J. Steele" wrote:

Make that

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

or

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress), vbDirectory)) =
0
Then


If it still doesn't work, does HyperlinkAddress (or HyperlinkPart) return
a
terminating slash?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" wrote in message
...
That's supposed to be

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDir)) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
Not a problem, Douglas!

I had changed it to vbDirectory and same results. And yes the = 0 is
on
one
line =) The code won't work without that on one line

Here's a copy of the coding - It's working great except it's still
showing
"File/Directory not found" for the scanned links that are linking to a
directory. I click on the link in the query that feeds this report
and
the
link opens up the directory in Windows Explorer which is correct. I'm
totally stumped on this because it should be working! The code look
100%
right to my eyes...



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, vbDir))) = 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub

"Douglas J. Steele" wrote:

Sorry, I was going by memory. Where I have acDirectory, it should be
vbDirectory. (Hopefully you realize that the = 0 Then part should be
on
the
same line)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Douglas,

That exact coding produced errors but I did do the following ways
and
I
still get the "File/Directory Not Found" on the ones that have
valid
links
to
the directories (The links to files work perfectly! I am still
doing
backflips over this!)

Here are the three different ways I've tried:

Your exact coding kept producing errors -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress),
acDirectory))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


So I fixed it to do this (No errors in the codings and the report
ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
acDirectory)))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



And this way (No errors and report ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acDirectory))) = 0
Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



Then lastly, out of desperation, broke them up into two separate If
Statements thinking maybe that was why it wouldn't work
originally....


Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "file not found"
Else
Me.Text83 = "File confirmed"
End If

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
vbDirectory)))
= 0 Then
Me.Text83 = "Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If

End Sub


I am so sorry to keep pestering you - But I'm so close I can taste
it
so...
I'm like a dog with a bone; I won't let go until it's done =)


VF


"Douglas J. Steele" wrote:

Try playing with

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress)),
vbDirectory)
= 0 Then
Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
news It works beautifully! I'm so happy about this =) This is
FANTASTIC!

Now just a couple more questions (for anyone who has the time to
respond!)

Sometimes we have JE's that are too large to be in one file so
we
have
to
break them up into two files - When this occurs they're stored
in a
directory
and the link is to the directory, not a file because it's more
than
one
file.
When it sees these, it's showing it, of course, as "File Not
Found"
which
is
true because it isn't a file. Is there a way I could add
another
Iif
statement that would tell it if it is a Dir standalone, to state
"Directory
Found"?

Also, is there a way I could have another report to only show
the
"File
Not
Found"? This way I could pass these out accordingly and get
these
links
fixed.

MANY MANY MANY thanks to you, Douglas, a true genius, and to all
you
geniuses out there!! =)



"Douglas J. Steele" wrote:

Try

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "File not found"
Else
Me.Text83 = "File confirmed"
End If

End Sub


If you still run into problems, try

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link))) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
...
Ooohh - I made myself sound silly - I took out the MsgBox
(that
was
there
for
referencial purposes) and with the MsgBox out of the way, it
just
goes
straight to the coding line - So I'm sure I have that wrong
somehow.

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Scanned_JE_Link, acAddress))) = 0
Then
Let Text83 = "File not found"
Else
Let Text83 = "File confirmed"
End If



  #25  
Old July 2nd, 2008, 08:22 PM posted to microsoft.public.access.forms
Vylent Fyre[_2_]
external usenet poster
 
Posts: 41
Default Hyperlink question

Please forgive my tardiness in this reply; it's month end close around here
and it's a quarterly one, plus the director of accounting is out on vacation
so it's been crazy hectic around here! =)

I can't figure out how to change it (Sandbox mode) since I am not able to
change the macro settings (to low) at this time. I'm running Access 2002 so
I am not for certain it would apply to me.

I am in the middle of trying to incorporate this logic into an expression in
a query at this time - I'm not having much luck because it keeps kicking back
saying "Dir" is an invalid function. This is what I have (I'm sure it's not
right obviously)


File Confirmed:
IIf(Len(Dir(HyperlinkPart([Scanned_JE_Link],[acAddress])))=0,"File Not Found")



"Douglas J. Steele" wrote:

I believe the only way would be to put the logic to determine
"File/Directory not found", "Dir confirmed" and "File confirmed" into the
query. You could try creating a function that returns the value and calling
the function in your query, but you could run into problems, depending on
the Sandbox Mode under which you're running.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
One more thing - Is there a way I could add a sort option? Basically, I'd
like the report to show the "File/Directory not found" on top of the
report,
then "Dir confirmed" then "File confirmed" - could I make the report do
this
with this coding? I know how to write it if it was a field but this isn't
a
field/control....


"Douglas J. Steele" wrote:

Make that

If Len(Dir(HyperlinkAddress(Me.Scanned_JE_Link), vbDirectory)) = 0 Then

or

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress), vbDirectory)) =
0
Then


If it still doesn't work, does HyperlinkAddress (or HyperlinkPart) return
a
terminating slash?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" wrote in message
...
That's supposed to be

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link), vbDir)) = 0 Then


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in message
...
Not a problem, Douglas!

I had changed it to vbDirectory and same results. And yes the = 0 is
on
one
line =) The code won't work without that on one line

Here's a copy of the coding - It's working great except it's still
showing
"File/Directory not found" for the scanned links that are linking to a
directory. I click on the link in the query that feeds this report
and
the
link opens up the directory in Windows Explorer which is correct. I'm
totally stumped on this because it should be working! The code look
100%
right to my eyes...



Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, vbDir))) = 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub

"Douglas J. Steele" wrote:

Sorry, I was going by memory. Where I have acDirectory, it should be
vbDirectory. (Hopefully you realize that the = 0 Then part should be
on
the
same line)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Douglas,

That exact coding produced errors but I did do the following ways
and
I
still get the "File/Directory Not Found" on the ones that have
valid
links
to
the directories (The links to files work perfectly! I am still
doing
backflips over this!)

Here are the three different ways I've tried:

Your exact coding kept producing errors -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress),
acDirectory))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


So I fixed it to do this (No errors in the codings and the report
ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
acDirectory)))
= 0 Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



And this way (No errors and report ran) -

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0 Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acDirectory))) = 0
Then

Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub



Then lastly, out of desperation, broke them up into two separate If
Statements thinking maybe that was why it wouldn't work
originally....


Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then
Me.Text83 = "file not found"
Else
Me.Text83 = "File confirmed"
End If

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress,
vbDirectory)))
= 0 Then
Me.Text83 = "Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If

End Sub


I am so sorry to keep pestering you - But I'm so close I can taste
it
so...
I'm like a dog with a bone; I won't let go until it's done =)


VF


"Douglas J. Steele" wrote:

Try playing with

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress))) = 0
Then

If Len(Dir(HyperlinkPart(Me.Scanned_JE_Link, acAddress)),
vbDirectory)
= 0 Then
Me.Text83 = "File/Directory not found"
Else
Me.Text83 = "Directory confirmed"
End If
Else
Me.Text83 = "File confirmed"
End If

End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Vylent Fyre" wrote in
message
news It works beautifully! I'm so happy about this =) This is
FANTASTIC!

Now just a couple more questions (for anyone who has the time to
respond!)

Sometimes we have JE's that are too large to be in one file so
we
have
to
break them up into two files - When this occurs they're stored
in a
directory
and the link is to the directory, not a file because it's more
than
one
file.
When it sees these, it's showing it, of course, as "File Not
Found"
which
is
true because it isn't a file. Is there a way I could add
another
Iif
statement that would tell it if it is a Dir standalone, to state
"Directory
Found"?

Also, is there a way I could have another report to only show
the
"File
Not
Found"? This way I could pass these out accordingly and get
these
links
fixed.

MANY MANY MANY thanks to you, Douglas, a true genius, and to all
you

  #26  
Old July 2nd, 2008, 10:08 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Hyperlink question

Check http://support.microsoft.com/kb/294698

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Vylent Fyre" wrote in message
...
Please forgive my tardiness in this reply; it's month end close around
here
and it's a quarterly one, plus the director of accounting is out on
vacation
so it's been crazy hectic around here! =)

I can't figure out how to change it (Sandbox mode) since I am not able to
change the macro settings (to low) at this time. I'm running Access 2002
so
I am not for certain it would apply to me.

I am in the middle of trying to incorporate this logic into an expression
in
a query at this time - I'm not having much luck because it keeps kicking
back
saying "Dir" is an invalid function. This is what I have (I'm sure it's
not
right obviously)


File Confirmed:
IIf(Len(Dir(HyperlinkPart([Scanned_JE_Link],[acAddress])))=0,"File Not
Found")



"Douglas J. Steele" wrote:

I believe the only way would be to put the logic to determine
"File/Directory not found", "Dir confirmed" and "File confirmed" into the
query. You could try creating a function that returns the value and
calling
the function in your query, but you could run into problems, depending on
the Sandbox Mode under which you're running.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.