Newbie needs help with Hyperlink code

chris01252

Registered User.
Local time
Today, 06:35
Joined
Feb 27, 2007
Messages
43
I am trying to create a hyperlink from other values in a number of fields, I have found a thread which I think anwers my problem:

Link to Thread

Only problem I is I don't really understand it. :confused:

e.g.

Dim stGunlib As String
Dim stGunlib2 As String

stGunlib2 = Me![Stock number]
stGunlib = "#http://www.shooting.uk.com/Gunlibrary/" + stGunlib2 + ".jpg#"
Me![Link] = stGunlib
Me![Picture] = stGunlib

What does Dim, Me!, As String mean? and where would this code be entered, is it part of a module or just in the properties of a table/form etc?

Any help on explanations of this would be greatly appreciated!
 
Dim creates a variable in RAM (a place in memory to store values)
String is the data type (Text) of the variable.
ME! Refers to the object (Form/Report) where the class module is located (VBA code on the Form or Report).

You can add a command button to create the hyperlink when clicked.

Private Sub cmdButton_Click()
Me!YourHyperLinkField = "#http://" & Me!YourTextBox & "#"
End Sub
 
cheers mate, that sorted it and thanks for the explanation

I have posted a related problem concerning file extensions here

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom