473,568 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use InStr Function to get hyperlink display text?

I store hyperlinks as text in a table like this:
Invoice11-21-2003.pdf#file://P:\Finance\Pref Vendors\Receipt s\Invoice11-21-20
03.pdf

I need to run a report that lists the documents - or whatever the display
text of the hyperlink is.
As it is now, the entire hyperlink appears in the report - I'm trying to
display just the document name.

I've used this elsewhere to get the display text:

astrFile = Split(varFile, "\")
strDt = astrFile(UBound (astrFile))

But how to get this to work with the report?

The report has a query for a RecordSource, so I'm limited to using code
within the text box on the Report that is bound to the query. Is there a
way to use the IIf Function in the text box with the InStr Function? or
perhaps something like...

=IIf (astrFile = Split(varFile, "\"), strDt =
astrFile(UBound (astrFile)))

I've tried to use code in the Report's module, but that fails because the
textbox is bound to the query which gets the hyperlink text string from the
table.

any suggestion welcome...

Thanks!
Nov 12 '05 #1
3 9483
If you're using a newer version of Access (not ver 97) you can use
the InStrRev() function to get the last occurance. Otherwise you
have to loop.

strOut = Right([myField], Len([myField]) - InStrRev([myField],"\")

If you are using Access 97, post back and request the LastInStr()
function code. I'm not sure who wrote it, but it's been around forever.
--

Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast
"deko" <dj****@hotmail .com> wrote ...
I store hyperlinks as text in a table like this:
Invoice11-21-2003.pdf#file://P:\Finance\Pref Vendors\Receipt s\Invoice11-21-20
03.pdf

I need to run a report that lists the documents - or whatever the display
text of the hyperlink is.
As it is now, the entire hyperlink appears in the report - I'm trying to
display just the document name.

I've used this elsewhere to get the display text:

astrFile = Split(varFile, "\")
strDt = astrFile(UBound (astrFile))

But how to get this to work with the report?

The report has a query for a RecordSource, so I'm limited to using code
within the text box on the Report that is bound to the query. Is there a
way to use the IIf Function in the text box with the InStr Function? or
perhaps something like...

=IIf (astrFile = Split(varFile, "\"), strDt =
astrFile(UBound (astrFile)))

I've tried to use code in the Report's module, but that fails because the
textbox is bound to the query which gets the hyperlink text string from the
table.

any suggestion welcome...

Thanks!

Nov 12 '05 #2
I would use HyperlinkPart() to get either the address, display text, or both. I
could then use Instr() on the results of the HyperlinkPart() function

deko wrote:
I store hyperlinks as text in a table like this:

Invoice11-21-2003.pdf#file://P:\Finance\Pref Vendors\Receipt s\Invoice11-21-20
03.pdf

I need to run a report that lists the documents - or whatever the display
text of the hyperlink is.
As it is now, the entire hyperlink appears in the report - I'm trying to
display just the document name.

I've used this elsewhere to get the display text:

astrFile = Split(varFile, "\")
strDt = astrFile(UBound (astrFile))

But how to get this to work with the report?

The report has a query for a RecordSource, so I'm limited to using code
within the text box on the Report that is bound to the query. Is there a
way to use the IIf Function in the text box with the InStr Function? or
perhaps something like...

=IIf (astrFile = Split(varFile, "\"), strDt =
astrFile(UBound (astrFile)))

I've tried to use code in the Report's module, but that fails because the
textbox is bound to the query which gets the hyperlink text string from the
table.

any suggestion welcome...

Thanks!


Nov 12 '05 #3
Great. Thanks for the tip - HyperlinkPart() is the ticket!
"Salad" <hi**********@r anch.com> wrote in message
news:3F******** *******@ranch.c om...
I would use HyperlinkPart() to get either the address, display text, or both. I could then use Instr() on the results of the HyperlinkPart() function

deko wrote:
I store hyperlinks as text in a table like this:

Invoice11-21-2003.pdf#file://P:\Finance\Pref Vendors\Receipt s\Invoice11-21-20 03.pdf

I need to run a report that lists the documents - or whatever the display text of the hyperlink is.
As it is now, the entire hyperlink appears in the report - I'm trying to
display just the document name.

I've used this elsewhere to get the display text:

astrFile = Split(varFile, "\")
strDt = astrFile(UBound (astrFile))

But how to get this to work with the report?

The report has a query for a RecordSource, so I'm limited to using code
within the text box on the Report that is bound to the query. Is there a way to use the IIf Function in the text box with the InStr Function? or
perhaps something like...

=IIf (astrFile = Split(varFile, "\"), strDt =
astrFile(UBound (astrFile)))

I've tried to use code in the Report's module, but that fails because the textbox is bound to the query which gets the hyperlink text string from the table.

any suggestion welcome...

Thanks!

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2187
by: marcokrechting | last post by:
Hi All, I have a rather complicated problem. I use following function to display a hyperlink: a="<"+"a href='"; b3="<"+"a href='http://nww."; L="</"+'a><br>'; function h(a){document.writeln(a)}
2
4716
by: Keith Wilby | last post by:
A2003, XP Pro. I have a text box on a form. The text box is bound to a hyperlink field. I want to use the contents of the text box in code so I'm assigning the contents to a string variable. Typically, the contents would be: T:\CSDI\Projects\Library\002\8021889.doc but when I look at the variable what I see is:...
2
2093
by: Keith Wilby | last post by:
I have a personnel database with a hyperlink field which contains the path to a mugshot. I was thinking of combining the hyperlink field with the surname field by putting the surname in the "Display Text" of the hyperlink. I have 200 or so existing records - can this be done either with code or in a query? I'm not sure of the syntax to use...
20
2984
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is a control. I have 2 files "displayCompanyJobs.aspx" and "displayCompanyOverview.aspx" which are in both the folder "/jobseeker/" and "/employer/"....
1
4513
by: oconndav | last post by:
Hi, I'm a newbie to web design, and have been piecing togther a site for a friend over the last few weeks basically by Googling everything I don't understand and trying to fit it all together. It's been an uplifting experince and have picked up some knowledge of MySQL, PHP, XML and AJAX along the way. I nearly have all of the functionality...
1
1743
by: mramsay | last post by:
Hi there, I have a dynamic hyperlink Baseball. When the user select the hyperlink they are redirected to another page. After that I want to display information on the page from my linkstbl. The information I want to display is Baseball and some text I have entered in the database. I'm having a problem displaying the two fields for...
2
2782
by: mdock | last post by:
Hello, I have a javascript grid on my ASP page which displays information about the history of specific units produced in our manufacturing facility. One of the results is the order number on which the unit was shipped. If the unit was not shipped, obviously there is no order number; the default value of this field on the data table is 0. ...
8
4451
by: webster5u | last post by:
Hi, I'm encounter a problem here. I hope somebody able helping me. i'm put a "log out" hyperlink overlap a image and that particular image is inside a table cell. I also try align the hyperlink on bottom and right at the cell but the problem is occur. If i set position as absolute then the image and hyperlink will leak out from table. If...
1
3759
by: sivasrec | last post by:
Hi, This is sivakumar from India. Now I am learning to ASP.NET 2.0.. I have a doubt.... I have used in a one hidden field control, 2 label controls, 2 button controls and one hyperlink controls. <asp:Label ID="Label1" runat="server" style="z-index: 1; left: 77px; top: 280px; position: absolute; height: 24px"
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.