473,813 Members | 4,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Hyperlinks

Tom
I have a project database in which I use hyperlinks to call up various
related supporting documents (e.g., proposals, contracts, reports,
site photos, etc.). The documentes are in Word, Excel, PDF and JPG
formats and are all stored in a documents subfolder on my computer. I
use a form with several Hyperlink text boxes (one for each type of
document) which are bound to a table that stores the hyperlinks. I
want the text box to respond to three conditions: 1)null value; 2) a
valid hyperlink address, and; 3) invalid hyperlink address (in the
event a document is deleted or moved).

I am able to satisfy the first two conditions with the following code
that is run when the text box is clicked:
=============== =============== =======
Private Sub txtWorkplan_Cli ck()
On Error GoTo Exit_txtWorkpla n_Click

Me.Refresh

If IsNull(Me.txtWo rkplan) Then
GoTo FindFile_txtWor kplan_Click
Else
GoTo OpenHyperlink_t xtWorkplan_Clic k
End If

OpenHyperlink_t xtWorkplan_Clic k:
DoCmd.RunComman d (acCmdOpenHyper link)
GoTo Exit_txtWorkpla n_Click

FindFile_txtWor kplan_Click:
Beep
Dim FindMessage As String
FindMessage = "Click 'OK' to browse for document file to be
registered in this field"
intResponse = MsgBox(FindMess age, vbOKCancel, "Register Document")
If intResponse = 2 Then
Beep
Else
DoCmd.RunComman d (acCmdEditHyper link)
End If
GoTo Exit_txtWorkpla n_Click

Exit_txtWorkpla n_Click:
Exit Sub

Err_txtWorkplan _Click:
Beep
Resume Exit_txtWorkpla n_Click

End Sub
=============== =============== ======

My problem is that I am unable to trap the standard error message that
arises when the hyperlink address is invalid (Unable to open
[filename]. Cannot open the specified file.) in order to initiate a
sub-routine that goes directly to
"DoCmd.RunComma nd (acCmdEditHyper link)" instead of the standard error
message. I can't seem to do it with "On Error"

I'm a self taught hack so please be specific...

Thanks in advance.

Tom
Nov 13 '05 #1
1 7939
Tom wrote:
I have a project database in which I use hyperlinks to call up various
related supporting documents (e.g., proposals, contracts, reports,
site photos, etc.). The documentes are in Word, Excel, PDF and JPG
formats and are all stored in a documents subfolder on my computer. I
use a form with several Hyperlink text boxes (one for each type of
document) which are bound to a table that stores the hyperlinks. I
want the text box to respond to three conditions: 1)null value; 2) a
valid hyperlink address, and; 3) invalid hyperlink address (in the
event a document is deleted or moved).

I am able to satisfy the first two conditions with the following code
that is run when the text box is clicked:
=============== =============== =======
Private Sub txtWorkplan_Cli ck()
On Error GoTo Exit_txtWorkpla n_Click

Me.Refresh

If IsNull(Me.txtWo rkplan) Then
GoTo FindFile_txtWor kplan_Click
Else
GoTo OpenHyperlink_t xtWorkplan_Clic k
End If

OpenHyperlink_t xtWorkplan_Clic k:
DoCmd.RunComman d (acCmdOpenHyper link)
GoTo Exit_txtWorkpla n_Click

FindFile_txtWor kplan_Click:
Beep
Dim FindMessage As String
FindMessage = "Click 'OK' to browse for document file to be
registered in this field"
intResponse = MsgBox(FindMess age, vbOKCancel, "Register Document")
If intResponse = 2 Then
Beep
Else
DoCmd.RunComman d (acCmdEditHyper link)
End If
GoTo Exit_txtWorkpla n_Click

Exit_txtWorkpla n_Click:
Exit Sub

Err_txtWorkplan _Click:
Beep
Resume Exit_txtWorkpla n_Click

End Sub
=============== =============== ======

My problem is that I am unable to trap the standard error message that
arises when the hyperlink address is invalid (Unable to open
[filename]. Cannot open the specified file.) in order to initiate a
sub-routine that goes directly to
"DoCmd.RunComma nd (acCmdEditHyper link)" instead of the standard error
message. I can't seem to do it with "On Error"

I'm a self taught hack so please be specific...

Thanks in advance.

Tom


Maybe consider using Dir() if the hyperlink uses a folder path name. If
Dir() returns a "" then the file does not exist. Then you can call the
API at hppt://www.mvps.org/access to do a file/open dialog.
Nov 13 '05 #2

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

Similar topics

10
15718
by: Imran | last post by:
Hi, I am attempting to create a CSS-driven website, in that I want to be able to control the display/content from the CSS file. I do not want to use tables. On a page, I have a background image (that contains smaller images) and I would like to assign the smaller images as hyperlinks. What is the best way to do this? I know I can use an imagemap, but is
6
3968
by: Colleyville Alan | last post by:
I have an application that has an Access table that stores the locations of slides in a Powerpoint file. This used to work fine when there were about 4 files and 200 slides. The database would open all four PPT files at once, and would loop through queriers for ever client and create custom presentations. Now there are 8 files, nearly 500 slides and the computer is bogging down with trying to open them all at once. I know that Access...
0
466
by: Tim | last post by:
Access 97: I have a table with a hyperlink field that I display on a form. I can click on the form field and the hyperlink activates correctly. However, if I try to activate the hyperlink using VB code, the last hyperlink that was clicked is the only one that displays. Background: The database is for providing instruction documentation for shop-floor personnel in a manufacturing environment. The main purpose of the database is to provide...
4
4259
by: Seefor | last post by:
Hi, I want my text hyperlinks to have a dotted border underneath, so I did this which works fine: a, a:link, a:visited, a:hover, a:active { color: #000; text-decoration: none;
1
1965
by: jez123456 | last post by:
Hi Experts I have a working c# application that users can store files (.doc, .xls, ..bmp, etc) as binary data into an Access database. I now need to extend this to also store hyperlinks. First of all I need some way of searching for the hyperlink. In Access there is an Insert Hyperlink dialog that can be used. Is there a similar dialog in c#? At the moment I use the OpenFileDialog to select files to be stored, could this be modified?
1
3653
by: Janna | last post by:
Hello tech savvy gurus! I hope someone can help me! THE PROBLEM: "Cannot open specified file" when I click on a hyperlink in an Access database when it is located on our server. THE BACKGROUND: I created a folder "Document Library" on my local drive, which contains document sub-folders and the database. For referential integrity, I designed the database with relative hyperlinks (e.g. Folder\File.pdf). The hyperlinks worked perfectly...
1
1953
by: mforema | last post by:
Hi Everybody, I have an Access table with a field filled with outdated hyperlinks. I also have an excel spreadsheet that is the master list for these hyperlinks. The spreadsheet will be updated by someone else whenever the links change. However, I don't always want to have to manually update my links whenever the spreadsheet is changed. Instead of manually updating 100's of hyperlinks, I would like to create a macro or something that will...
3
2873
by: prinsipe | last post by:
Hi all, what i'm doing is showing/hiding hyperlinks depending on the hyperlink clicked. it is partially working. when i call step1, all hyperlinks are hidden. but then i call step2, single and mulitple is visible. the problem is when i call step1 again, it does not hide single and multiple hyperlinks. any idea to solve my problem? thanks in advance! below is my sample script... function Step1() {...
12
5601
by: Frustratee | last post by:
Sorry guys, this is killing me. I have been fighting this issue for several weeks, to no avail. I am exporting the results of a query to an excel sheet, with one of the columns being from a field of hyperlinks that link to files on the shared drive. I CANNOT get the hyperlinks to be assigned. I can change the field name, but not the hyperlink address. Can't figure it out. 1) I have a header row 2) Column 16 is where the hyperlinks are...
0
9607
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10665
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10420
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9221
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7681
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5568
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.