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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink to web address containing contents of form field 1

Status
Not open for further replies.

wakeywakey

IS-IT--Management
Oct 21, 2001
6
GB
Hi

I would like to be able to press a button on a form to generate a hyperlink to a web page. The hyperlink will be to an address like [EPIC].htm where [EPIC] is the contents of the EPIC field visible on the current record being displayed on the form.

I have tried out successfully to edit the property for a macro button so that when I press it, the following happens:

strLink="followhyperlink strLink

but this should look like:

ContentsOfEPICField=????????????????????????????/
strLink=" & ".htm"

Can you help with the questions marks please?

Or start from the beginning if this is way off!

Thanks

wakey
 
wakeywakey,
To just pull the contents of a text field on the current form you could use this:

Dim strPage as string
strPage = Me![EPIC]
or
strPage = form_xxx![EPIC]
(where xxx is the form name)

and set the string as follows

strLink = " & strPage & ".htm"

the above does not deal with the fact that the field may be null/blank so you may want to add that check.
 
Just to say thanks for responding. I have tested out your suggestion, and it works perfectly. I programmed in assembler and other low level languages years ago, but VB is a bit like straying on to someone else's traffic management system whilst peddling a bicycle. If you or anyone else can point me to any books, web resources etc that really tell you how to do useful things rather than tell you in detail every word in the dictionary or how esoteric the grammar is I'd be most grateful.

Thanks for your help!

wakey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top