Solved

Inserting Hyperlinks using VBA

Posted on 2004-04-22
8
1,472 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

615 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