Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Code for Inserting Hyperlinks 1

Status
Not open for further replies.

Thom

Technical User
Apr 29, 2000
18
AU
Hello everyone,<br>I recently posted a request for inserting hyperlinks but realise now that the brief may have been a little too lateral. I actually need the VBA code. I already have thousands of scanned documents in a directory all with the names of their bar-code identifiers eg 123.tif, 456.tif. When an operator enters the bar-code number '123' into a text box, I want to be able to click a command button and 'acquire' that tif file as a hyperlink into the current record. Thanks
 
A &quot;Hyperlink&quot; is used for Internet. <br>The &quot;CORRECT&quot; term Load an Image into your form.<br><br>Private Sub Form_Current()<br>&nbsp;&nbsp;&nbsp;&nbsp;If Me![YourTextBox] &lt;&gt; 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me!Image14.Picture = &quot;p:\ViewPhotos\Photos\&quot; & Me![YourTextBox] & &quot;.tif&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br><br><br><br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thanks Doug,<br>I've introduced the code as per your reply. Everything appears to work ie it looks like a standard hyperlink but upon clicking on the field, it does not follow the path. Upon further investigation the path you see 'underlined in blue' is in fact the 'Display Text' element of the hyperlink field. There is no actual path in the 'Link to file or URL'.&nbsp;&nbsp;If you edit one character in the hyperlink field, say delete the &quot;f&quot; in *.tiff and retype it, the link will then be established as per normal.<br>Thanks for your help...<br>Tom
 
Doug,<br>I now have inserted a '#' before the drive letter ... Me!Image14.Picture = &quot;#p:\ViewPhotos\Photos\&quot; & Me![YourTextBox] & &quot;.tif&quot; and it now points to the actual address.<br>The correct syntax is 'displaytext#address#subaddress'.<br>All is well now.&nbsp;&nbsp;Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top