Solved

Access 97 How to Define the Field Type with a create table query to be Hyperlink

Posted on 2003-11-25
7
1,608 Views
Last Modified: 2010-08-05
Access 97
I am using a make table query to create a list of hyperlinks to files stored on a remote server.
When I run this query it creates the new table, but the new field is of the type text.
How do I get the Query to create this new table but have the field type as a hyperlink instead of just text?

I have a record type called STOCKNO
STOCKNO is a text field similar to the following:
DK-12345JV

I am extracting  the first two characters and then only the numeric portion of this field  DK12345 and creating a link to a word documet in the form of

j:\sales\quotes\writeups\DK12345.doc

I would like this to then be stored in a new table as a hyperlink.

here is the Expression I am using...

link: "j:\sales\quotes\writeups\" & Left$([STOCKNO],2) & Val(Right$(Trim$([STOCKNO]),Len(Trim$([STOCKNO]))-InStr(Trim$([STOCKNO]),"-"))) & ".doc"

this creates a new field called link in the new table

This works as expected, but when the new table is created the field is of the type text.

where or how do I get the query to create a field of the type Hyperlink instead?
0
Comment
Question by:vpcnc
  • 4
  • 2
7 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9819345
Hey vpcnc!

  There is no "hyperlink" property on a table.  
  You can simple store the hyperlink value then you can use the FollowHyperlink method to fire the hyperlink.

  I'm thinking there should be a form involved here somewhere also,....

regards
Jack
0
 
LVL 1

Author Comment

by:vpcnc
ID: 9819401
Thanks Jack...

When I Manualy create a new table I can select Hyperlink as one of the field types.
So there should be a way to create this field type using a Make table Query...

I will even fore go the Make table query for a Access Basic Module that will complete the same task...

the only requirement is that the new table must have this field definde as a hyperlink and not just as text...

George
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9819438
I lied.... Its the datatype itself (as you can tell...) sorry to mislead.

Instead of a make table, how about appending to a pre-built template table?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 32

Expert Comment

by:jadedata
ID: 9819445
I am trying to locate the datatype constant for the hyperlink field type,...
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9819451
For tables where the make table query is just too simple...
I build the table the way I want it and append into it with a query.

docmd.copyobject will create the new unfilled version
docmd.execute "AppendQuery", dbfailonerror,... will fill the new copy of the table.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 9820546
As I understand it Jet knows nothing about Hyperlinks.  A hyperlink field is really a memo field with an <Access> interpretation applied to it.
If this is correct, then you will not be able to create a hyperlink field in JET SQL.  

To create a hyperlink field in code you can use the following example as a guide.
This code creates a table with a single field which is a hyperlink.

Pete


    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field

    Set db = CurrentDb
    Set tdf = db.CreateTableDef("Tablename")
    Set fld = tdf.CreateField("MyHyperlink", dbMemo)
    fld.Attributes = dbHyperlinkField
    tdf.Fields.Append fld
    tdf.Fields.Refresh
    db.TableDefs.Append tdf
    db.TableDefs.Refresh
    Set fld = Nothing
    Set tdf = Nothing
    Set db = Nothing

 
0
 
LVL 1

Author Comment

by:vpcnc
ID: 9820745
Pete

Thank you for your explanation and example...
I think my answer relies on using a combination of your reply and jack's repy

I can use your Create Table method initially and then use an append query to append the Hyperlinks.

So how do I go about awarding these points?

 
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

839 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