create hyperlink: "predefined text string+number field from the table"

U

Uriel TK

Hello!
I am creating a small, simple table + form. every record
has:
1)a catalog number
2)a link to a local file
3)a text field for description
4)a yes/no box
5)autonumber which is the primary key.
I want to create a 6th field, which is a hyperlink to a
web site catalog, that opens the web browser when clicked
on. the hyperlink consists of a constant string which is
the address and query command of the site, followed by
the catalog number:
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?
cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7706722
All this string is constant except the last
number "7706722" which is the same as the catalog number
that i enter in the 1st field of the table. Please note
that the catalog number is an integer, and its length is
not fixed, ranging from 6 to 9 characters.
I could of course copy and paste the link for every
record, but i want automation since i have to input a lot
of records. I want this 6th field to be composed
automatically from the predefined string + the catalog
number i enter manually. A nice plus would be the ability
to change eventually the predefined string in case they
change address or engine or format.
How do i create such a field?

Thanks a lot!
Uriel.
 
T

Tom Wickerath

You can build your hyperlink in VBA code. Here is a code snippet (ie. not a complete procedure)
for code behind a form that includes two textboxes: txtHyperlinkTextToDisplay and txtCatNum. The
first text box allows you to enter text that will appear as the clickable hyperlink, instead of
displaying the actual link. The other textbox, txtCatNum, contains your catalog number. The
string strHyperlink is then saved to a field in your table of Hyperlink data type.


Sub CreateHyperlink()
Dim strHyperlink As String

strHyperlink = txtHyperlinkTextToDisplay & _
"#http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=" _
& "Retrieve&db=pubmed&dopt=Abstract&list_uids=" _
& txtCatNum & "#"



Tom
__________________________________________


Hello!
I am creating a small, simple table + form. every record
has:
1)a catalog number
2)a link to a local file
3)a text field for description
4)a yes/no box
5)autonumber which is the primary key.
I want to create a 6th field, which is a hyperlink to a
web site catalog, that opens the web browser when clicked
on. the hyperlink consists of a constant string which is
the address and query command of the site, followed by
the catalog number:
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?
cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7706722
All this string is constant except the last
number "7706722" which is the same as the catalog number
that i enter in the 1st field of the table. Please note
that the catalog number is an integer, and its length is
not fixed, ranging from 6 to 9 characters.
I could of course copy and paste the link for every
record, but i want automation since i have to input a lot
of records. I want this 6th field to be composed
automatically from the predefined string + the catalog
number i enter manually. A nice plus would be the ability
to change eventually the predefined string in case they
change address or engine or format.
How do i create such a field?

Thanks a lot!
Uriel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top