Solved

Inserting Hyperlinks using VBA

Posted on 2004-04-22
8
1,432 Views
Last Modified: 2010-05-18
Hi all

I want a user to click a button which opens the hyperlink dialog box and then returns the hyperlink string when they're finished. I need a sample of vba code.

I've tried a few things and I have no idea how to open the hyperlink dialog box and the users want the standard one. Thanks in advance.

Cheers
STeve
0
Comment
Question by:sigs66
  • 4
  • 4
8 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 10887000
what do u mean, open the hyperlink dialog box?

0
 
LVL 2

Author Comment

by:sigs66
ID: 10887567
the dialog that comes up when you use the insert hyperlink or press control K
0
 
LVL 2

Author Comment

by:sigs66
ID: 10906481
Please help

Cheers
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10907247
Ive been having a look and quite find out to bring up this box
Ive not managed to find this hyperlink box
I will try to hep but you need to give me an example of where you insert a link so I can see what dialog you are talking about

I know you said user wants standard one but would you be open to alternatives? Try create a form similar to dialog if we cant get it to open

what do you want to do, prompt user for a hyperlink, they enter it? or pick one from a pre-defined list

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Author Comment

by:sigs66
ID: 10910772
Hi

There is a table and one of the fields is a hyperlink field. The users open a form which displays relevant records from this table. When you click on the field you can get the insert hyperlink dialog by pressing control K, or  going to the insert menu and selecting the insert hyperlink, or right clicking on the field and selecting hyperlink, and then edit hyperlink.

I can create a custom form myself - I am familiar with the hyperlink object and vba coding but the users have been the standard dialog and want it. Recreating this particular form is quite complex. The standard dialog also lets you link to access forms and reports which is also used quite a lot.

Cheers Steve
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 10911026
ok, think Ive got it, after you telling me, I now know what you mean

setfocus to your hyperlink field
    HLink.SetFocus

Run the command to edit hyperlink
    DoCmd.RunCommand acCmdEditHyperlink


Its important you set the focus other edithyperlink command will fail

also you need to check return values, if Cancel hit, it returns a failure so you need to trap it
0
 
LVL 2

Author Comment

by:sigs66
ID: 10911171

DOHHHHHHHHH - Call me Homer J Simpson

I was looking for something complex and difficult and it's this simple. Thanks your help is much appreciated.

The error code is 2501 if you're interested.

Cheers
Steve
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10911868
yea,it was easier than I thought as well
still Ive learnt summat new as well

take a look at RunCommand next time u want to do summat, theres loads of ops inthere

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now